Skip to content

Commit 5ce0f41

Browse files
committed
address review comments
1 parent df2570e commit 5ce0f41

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

google/cloud/storage/internal/bucket_requests.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@ StatusOr<ListBucketsResponse> ListBucketsResponse::FromHttpResponse(
243243
result.items.emplace_back(std::move(*parsed));
244244
}
245245

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-
}
246+
auto const& unreachable = json["unreachable"];
247+
result.unreachable.reserve(unreachable.size());
248+
for (auto const& bucket : unreachable) {
249+
result.unreachable.push_back(bucket.get<std::string>());
250250
}
251251

252252
return result;

0 commit comments

Comments
 (0)