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:
parent
f463a6c794
commit
b4c96c2094
|
@ -104,8 +104,7 @@ int main(int, char**)
|
|||
// site.688b70499b9a41a08f498ed6e932960c.openstack
|
||||
// site.dbefc23dcc594577a8bfa4db4f9b0a8f.openstack
|
||||
|
||||
auto val = cache.get(hostname);
|
||||
if (val.has_value()) {
|
||||
if (auto val = cache.get(hostname)) {
|
||||
cout << val.value() << endl;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue