We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df2570e commit 5ce0f41Copy full SHA for 5ce0f41
google/cloud/storage/internal/bucket_requests.cc
@@ -243,10 +243,10 @@ StatusOr<ListBucketsResponse> ListBucketsResponse::FromHttpResponse(
243
result.items.emplace_back(std::move(*parsed));
244
}
245
246
- if (json.count("unreachable") != 0) {
247
- for (auto const& kv : json["unreachable"].items()) {
248
- result.unreachable.push_back(kv.value().get<std::string>());
249
- }
+ auto const& unreachable = json["unreachable"];
+ result.unreachable.reserve(unreachable.size());
+ for (auto const& bucket : unreachable) {
+ result.unreachable.push_back(bucket.get<std::string>());
250
251
252
return result;
0 commit comments