From 182925b7c0ef7a1cca7982c1a9e0c81fafa58266 Mon Sep 17 00:00:00 2001 From: "Bradley C. Kuszmaul" Date: Wed, 31 May 2023 16:06:22 -0400 Subject: Convert `raw_hash_set` comments from imperative to indicative mood. https://google.github.io/styleguide/cppguide.html#Function_Comments --- absl/container/internal/raw_hash_set.cc | 11 ++++++----- absl/container/internal/raw_hash_set.h | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/absl/container/internal/raw_hash_set.cc b/absl/container/internal/raw_hash_set.cc index b91d5a47..1ccee1ed 100644 --- a/absl/container/internal/raw_hash_set.cc +++ b/absl/container/internal/raw_hash_set.cc @@ -107,21 +107,22 @@ FindInfo find_first_non_full_outofline(const CommonFields& common, return find_first_non_full(common, hash); } -// Return address of the ith slot in slots where each slot occupies slot_size. +// Returns the address of the ith slot in slots where each slot occupies +// slot_size. static inline void* SlotAddress(void* slot_array, size_t slot, size_t slot_size) { return reinterpret_cast(reinterpret_cast(slot_array) + (slot * slot_size)); } -// Return the address of the slot just after slot assuming each slot -// has the specified size. +// Returns the address of the slot just after slot assuming each slot has the +// specified size. static inline void* NextSlot(void* slot, size_t slot_size) { return reinterpret_cast(reinterpret_cast(slot) + slot_size); } -// Return the address of the slot just before slot assuming each slot -// has the specified size. +// Returns the address of the slot just before slot assuming each slot has the +// specified size. static inline void* PrevSlot(void* slot, size_t slot_size) { return reinterpret_cast(reinterpret_cast(slot) - slot_size); } diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h index 03f236f2..2880af70 100644 --- a/absl/container/internal/raw_hash_set.h +++ b/absl/container/internal/raw_hash_set.h @@ -376,12 +376,12 @@ class NonIterableBitMask { return static_cast((bit_width(mask_) - 1) >> Shift); } - // Return the number of trailing zero *abstract* bits. + // Returns the number of trailing zero *abstract* bits. uint32_t TrailingZeros() const { return container_internal::TrailingZeros(mask_) >> Shift; } - // Return the number of leading zero *abstract* bits. + // Returns the number of leading zero *abstract* bits. uint32_t LeadingZeros() const { constexpr int total_significant_bits = SignificantBits << Shift; constexpr int extra_bits = sizeof(T) * 8 - total_significant_bits; @@ -1361,7 +1361,7 @@ ABSL_ATTRIBUTE_NOINLINE void InitializeSlots(CommonFields& c, Alloc alloc) { struct PolicyFunctions { size_t slot_size; - // Return the hash of the pointed-to slot. + // Returns the hash of the pointed-to slot. size_t (*hash_slot)(void* set, void* slot); // Transfer the contents of src_slot to dst_slot. -- cgit v1.2.3