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/synchronization/internal | |
parent | 0b49f8af79989341c6a5d02b6a6ab0c32e64adf0 (diff) | |
parent | a26fc02d1ea9a2f0770c1297db0a049b9dd4b941 (diff) |
Merge pull request #1416 from AtariDreams:fill
PiperOrigin-RevId: 526675031
Change-Id: Ib84423ccea2d0183166194a0916a97a7ed32915c
Diffstat (limited to 'absl/synchronization/internal')
-rw-r--r-- | absl/synchronization/internal/graphcycles.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/synchronization/internal/graphcycles.cc b/absl/synchronization/internal/graphcycles.cc index feec4581..01489544 100644 --- a/absl/synchronization/internal/graphcycles.cc +++ b/absl/synchronization/internal/graphcycles.cc @@ -114,7 +114,7 @@ class Vec { if (src->ptr_ == src->space_) { // Need to actually copy resize(src->size_); - std::copy(src->ptr_, src->ptr_ + src->size_, ptr_); + std::copy_n(src->ptr_, src->size_, ptr_); src->size_ = 0; } else { Discard(); @@ -148,7 +148,7 @@ class Vec { size_t request = static_cast<size_t>(capacity_) * sizeof(T); T* copy = static_cast<T*>( base_internal::LowLevelAlloc::AllocWithArena(request, arena)); - std::copy(ptr_, ptr_ + size_, copy); + std::copy_n(ptr_, size_, copy); Discard(); ptr_ = copy; } |