diff options
author | Thomas Köppe <tkoeppe@google.com> | 2022-08-04 06:14:14 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-08-04 06:15:05 -0700 |
commit | 4b551344e6ba3243636d841d5a2d944a20a3a956 (patch) | |
tree | 95f8c347117f509f5aa9fab0b05f3c55d1ce73cf /absl/strings/str_cat.cc | |
parent | 751ade00ee347abef5dac7248db851e3f2012e14 (diff) |
Revert change "Fix "unsafe narrowing" warnings in absl, 4/n.".
The change breaks existing code by changing the return type of absl::bit_width.
PiperOrigin-RevId: 465295951
Change-Id: Id4ce7c2ac3699ce22aa2b4851a949f9e0104a3d7
Diffstat (limited to 'absl/strings/str_cat.cc')
-rw-r--r-- | absl/strings/str_cat.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/strings/str_cat.cc b/absl/strings/str_cat.cc index 2f9df673..f4a77493 100644 --- a/absl/strings/str_cat.cc +++ b/absl/strings/str_cat.cc @@ -56,7 +56,7 @@ AlphaNum::AlphaNum(Dec dec) { *--writer = '0' + (value % 10); value /= 10; } - *--writer = '0' + static_cast<char>(value); + *--writer = '0' + value; if (neg) *--writer = '-'; ptrdiff_t fillers = writer - minfill; @@ -73,7 +73,7 @@ AlphaNum::AlphaNum(Dec dec) { if (add_sign_again) *--writer = '-'; } - piece_ = absl::string_view(writer, static_cast<size_t>(end - writer)); + piece_ = absl::string_view(writer, end - writer); } // ---------------------------------------------------------------------- |