summaryrefslogtreecommitdiff
path: root/absl/status/status.cc
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2020-09-01 09:39:43 -0700
committerGravatar Mark Barolak <mbar@google.com>2020-09-01 15:41:52 -0400
commit0e9921b75a0fdd639a504ec8443fc1fe801becd7 (patch)
tree7e1cc238c43f7b31e7a5f0bcb3c8536ee29d55a6 /absl/status/status.cc
parenta4cbb5f698c42845aab6a6d6318290205e6c5baf (diff)
Export of internal Abseil changes
-- 23500704dd7c2642fad49f88c07ce41ebaab12e4 by Abseil Team <absl-team@google.com>: Change fetch_add() to store(1 + load()) As there is only one concurrent writer to the Info struct, we can avoid using the more expensive fetch_add() function. PiperOrigin-RevId: 329523785 -- 79e5018dba2e117ad89b76367165a604b3f24045 by Abseil Team <absl-team@google.com>: Record rehash count in hashtablez This will help identify which containers could benefit from a reserve call. PiperOrigin-RevId: 329510552 -- e327e54b805d67556f934fa7f7dc2d4e72fa066a by Abseil Team <absl-team@google.com>: Fix -Wsign-compare issues. These lines could theoretically have overflowed in cases of very large stack traces etc. Very unlikely, but this was causing warnings when built with -Wsign-compare, which we intend to enable with Chromium. In none of these three cases is it trivial to switch to a range-based for loop. PiperOrigin-RevId: 329415195 -- 08aca2fc75e8b3ad1201849987b64148fe48f283 by Xiaoyi Zhang <zhangxy@google.com>: Release absl::StatusOr. PiperOrigin-RevId: 329353348 -- bf4d2a7f8b089e2adf14d32b0e39de0a981005c3 by Xiaoyi Zhang <zhangxy@google.com>: Internal change PiperOrigin-RevId: 329337031 -- 42fa7d2fb993bbfc344954227cf1eeb801eca065 by Abseil Team <absl-team@google.com>: Internal change PiperOrigin-RevId: 329099807 GitOrigin-RevId: 23500704dd7c2642fad49f88c07ce41ebaab12e4 Change-Id: I6713e4ca3bb0ab2ced5e487827ae036ab8ac61f1
Diffstat (limited to 'absl/status/status.cc')
-rw-r--r--absl/status/status.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/status/status.cc b/absl/status/status.cc
index 0a655736..a27fd8b3 100644
--- a/absl/status/status.cc
+++ b/absl/status/status.cc
@@ -78,7 +78,7 @@ static int FindPayloadIndexByUrl(const Payloads* payloads,
absl::string_view type_url) {
if (payloads == nullptr) return -1;
- for (int i = 0; i < payloads->size(); ++i) {
+ for (size_t i = 0; i < payloads->size(); ++i) {
if ((*payloads)[i].type_url == type_url) return i;
}
@@ -167,7 +167,7 @@ void Status::ForEachPayload(
bool in_reverse =
payloads->size() > 1 && reinterpret_cast<uintptr_t>(payloads) % 13 > 6;
- for (int index = 0; index < payloads->size(); ++index) {
+ for (size_t index = 0; index < payloads->size(); ++index) {
const auto& elem =
(*payloads)[in_reverse ? payloads->size() - 1 - index : index];