google-cloud-cpp icon indicating copy to clipboard operation
google-cloud-cpp copied to clipboard

Use iterator to avoid double lookups in OAuth2 ComputeEngineCredentials

Open scotthart opened this issue 2 years ago • 0 comments

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.

scotthart avatar Jan 12 '24 17:01 scotthart