diff options
author | Copybara-Service <copybara-worker@google.com> | 2023-04-24 09:59:58 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-04-24 09:59:58 -0700 |
commit | 4ffaea74c1f5408e0757547a1ca0518ad43fa9f1 (patch) | |
tree | 8c3403be5038735b8247f7a5480be54ac65e29df /absl/strings/internal | |
parent | 0b49f8af79989341c6a5d02b6a6ab0c32e64adf0 (diff) | |
parent | a26fc02d1ea9a2f0770c1297db0a049b9dd4b941 (diff) |
Merge pull request #1416 from AtariDreams:fill
PiperOrigin-RevId: 526675031
Change-Id: Ib84423ccea2d0183166194a0916a97a7ed32915c
Diffstat (limited to 'absl/strings/internal')
-rw-r--r-- | absl/strings/internal/charconv_bigint.cc | 6 | ||||
-rw-r--r-- | absl/strings/internal/charconv_bigint.h | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/absl/strings/internal/charconv_bigint.cc b/absl/strings/internal/charconv_bigint.cc index 282b639e..46b5289a 100644 --- a/absl/strings/internal/charconv_bigint.cc +++ b/absl/strings/internal/charconv_bigint.cc @@ -296,10 +296,8 @@ template <int max_words> std::min(n / kLargePowerOfFiveStep, kLargestPowerOfFiveIndex); if (first_pass) { // just copy, rather than multiplying by 1 - std::copy( - LargePowerOfFiveData(big_power), - LargePowerOfFiveData(big_power) + LargePowerOfFiveSize(big_power), - answer.words_); + std::copy_n(LargePowerOfFiveData(big_power), + LargePowerOfFiveSize(big_power), answer.words_); answer.size_ = LargePowerOfFiveSize(big_power); first_pass = false; } else { 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; } |