diff options
Diffstat (limited to 'absl/container/internal')
-rw-r--r-- | absl/container/internal/hashtablez_sampler_test.cc | 2 | ||||
-rw-r--r-- | absl/container/internal/inlined_vector.h | 13 |
2 files changed, 4 insertions, 11 deletions
diff --git a/absl/container/internal/hashtablez_sampler_test.cc b/absl/container/internal/hashtablez_sampler_test.cc index d2435ed8a6ad..7f9e8dd21ffc 100644 --- a/absl/container/internal/hashtablez_sampler_test.cc +++ b/absl/container/internal/hashtablez_sampler_test.cc @@ -199,7 +199,7 @@ TEST(HashtablezSamplerTest, Sample) { SetHashtablezSampleParameter(100); int64_t num_sampled = 0; int64_t total = 0; - double sample_rate; + double sample_rate = 0.0; for (int i = 0; i < 1000000; ++i) { HashtablezInfoHandle h = Sample(); ++total; diff --git a/absl/container/internal/inlined_vector.h b/absl/container/internal/inlined_vector.h index a2b3d24d98e9..79533a41f3d2 100644 --- a/absl/container/internal/inlined_vector.h +++ b/absl/container/internal/inlined_vector.h @@ -22,6 +22,7 @@ #include <utility> #include "absl/container/internal/compressed_tuple.h" +#include "absl/memory/memory.h" #include "absl/meta/type_traits.h" namespace absl { @@ -35,15 +36,7 @@ using IsAtLeastForwardIterator = std::is_convertible< template <typename AllocatorType, typename ValueType, typename SizeType> void DestroyElements(AllocatorType* alloc_ptr, ValueType* destroy_first, SizeType destroy_size) { - using AllocatorTraits = std::allocator_traits<AllocatorType>; - - // Destroys `destroy_size` elements from `destroy_first`. - // - // Destroys the range - // [`destroy_first`, `destroy_first + destroy_size`). - // - // NOTE: We assume destructors do not throw and thus make no attempt to roll - // back. + using AllocatorTraits = absl::allocator_traits<AllocatorType>; for (SizeType i = 0; i < destroy_size; ++i) { AllocatorTraits::destroy(*alloc_ptr, destroy_first + i); } @@ -75,7 +68,7 @@ class Storage { using const_iterator = const_pointer; using reverse_iterator = std::reverse_iterator<iterator>; using const_reverse_iterator = std::reverse_iterator<const_iterator>; - using AllocatorTraits = std::allocator_traits<allocator_type>; + using AllocatorTraits = absl::allocator_traits<allocator_type>; explicit Storage(const allocator_type& alloc) : metadata_(alloc, /* empty and inlined */ 0) {} |