Use bool cast for testing optional<> value

We don't need the call to has_value, we can do it in the if directly.
This commit is contained in:
Monty Taylor 2019-02-11 15:21:54 +00:00
parent f463a6c794
commit b4c96c2094
1 changed files with 1 additions and 2 deletions

View File

@ -104,8 +104,7 @@ int main(int, char**)
// site.688b70499b9a41a08f498ed6e932960c.openstack // site.688b70499b9a41a08f498ed6e932960c.openstack
// site.dbefc23dcc594577a8bfa4db4f9b0a8f.openstack // site.dbefc23dcc594577a8bfa4db4f9b0a8f.openstack
auto val = cache.get(hostname); if (auto val = cache.get(hostname)) {
if (val.has_value()) {
cout << val.value() << endl; cout << val.value() << endl;
continue; continue;
} }