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/ascii.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/ascii.cc')
-rw-r--r-- | absl/strings/ascii.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/absl/strings/ascii.cc b/absl/strings/ascii.cc index 868df2d1..93bb03e9 100644 --- a/absl/strings/ascii.cc +++ b/absl/strings/ascii.cc @@ -157,13 +157,13 @@ ABSL_DLL const char kToUpper[256] = { void AsciiStrToLower(std::string* s) { for (auto& ch : *s) { - ch = absl::ascii_tolower(static_cast<unsigned char>(ch)); + ch = absl::ascii_tolower(ch); } } void AsciiStrToUpper(std::string* s) { for (auto& ch : *s) { - ch = absl::ascii_toupper(static_cast<unsigned char>(ch)); + ch = absl::ascii_toupper(ch); } } @@ -183,17 +183,17 @@ void RemoveExtraAsciiWhitespace(std::string* str) { for (; input_it < input_end; ++input_it) { if (is_ws) { // Consecutive whitespace? Keep only the last. - is_ws = absl::ascii_isspace(static_cast<unsigned char>(*input_it)); + is_ws = absl::ascii_isspace(*input_it); if (is_ws) --output_it; } else { - is_ws = absl::ascii_isspace(static_cast<unsigned char>(*input_it)); + is_ws = absl::ascii_isspace(*input_it); } *output_it = *input_it; ++output_it; } - str->erase(static_cast<size_t>(output_it - &(*str)[0])); + str->erase(output_it - &(*str)[0]); } ABSL_NAMESPACE_END |