diff options
Diffstat (limited to 'absl/strings')
-rw-r--r-- | absl/strings/escaping.cc | 5 | ||||
-rw-r--r-- | absl/strings/internal/charconv_bigint.cc | 4 | ||||
-rw-r--r-- | absl/strings/internal/charconv_bigint.h | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/absl/strings/escaping.cc b/absl/strings/escaping.cc index 2827fbaa..6103750a 100644 --- a/absl/strings/escaping.cc +++ b/absl/strings/escaping.cc @@ -846,9 +846,10 @@ void HexStringToBytesInternal(const char* from, T to, size_t num) { template <typename T> void BytesToHexStringInternal(const unsigned char* src, T dest, size_t num) { auto dest_ptr = &dest[0]; - for (auto src_ptr = src; src_ptr != (src + num); ++src_ptr, dest_ptr += 2) { + for (auto src_ptr = src; src_ptr != (src + num); ++src_ptr) { const char* hex_p = &numbers_internal::kHexTable[*src_ptr * 2]; - std::copy(hex_p, hex_p + 2, dest_ptr); + *dest_ptr++ = *hex_p++; + *dest_ptr++ = *hex_p; } } diff --git a/absl/strings/internal/charconv_bigint.cc b/absl/strings/internal/charconv_bigint.cc index 282b639e..552fecc6 100644 --- a/absl/strings/internal/charconv_bigint.cc +++ b/absl/strings/internal/charconv_bigint.cc @@ -296,9 +296,9 @@ template <int max_words> std::min(n / kLargePowerOfFiveStep, kLargestPowerOfFiveIndex); if (first_pass) { // just copy, rather than multiplying by 1 - std::copy( + std::copy_n( LargePowerOfFiveData(big_power), - LargePowerOfFiveData(big_power) + LargePowerOfFiveSize(big_power), + LargePowerOfFiveSize(big_power), answer.words_); answer.size_ = LargePowerOfFiveSize(big_power); first_pass = false; diff --git a/absl/strings/internal/charconv_bigint.h b/absl/strings/internal/charconv_bigint.h index 8f702976..d8992386 100644 --- a/absl/strings/internal/charconv_bigint.h +++ b/absl/strings/internal/charconv_bigint.h @@ -121,7 +121,7 @@ class BigUnsigned { ++size_; } } - std::fill(words_, words_ + word_shift, 0u); + std::fill_n(words_, word_shift, 0u); } } @@ -197,7 +197,7 @@ class BigUnsigned { } void SetToZero() { - std::fill(words_, words_ + size_, 0u); + std::fill_n(words_, size_, 0u); size_ = 0; } |