google-cloud-cpp
google-cloud-cpp copied to clipboard
Use iterator to avoid double lookups in OAuth2 ComputeEngineCredentials
Refactor
if (!body.contains("scopes")) return {};
auto const& s = body["scopes"];
and
if (!body.contains("email") || !body["email"].is_string()) return {};
return body.value("email", "");
to use an iterator.