summaryrefslogtreecommitdiff
path: root/absl/container/internal/raw_hash_set.cc
diff options
context:
space:
mode:
authorGravatar Copybara-Service <copybara-worker@google.com>2023-06-01 11:18:52 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-06-01 11:18:52 -0700
commit1561ee614e02d3bc6b6388d5fe5dc7fe4eab3184 (patch)
treead872a9b83dbd4f17246c45d67b52c0e9e2d32d0 /absl/container/internal/raw_hash_set.cc
parent71ffb09f8c27849c7e92595b5ac883b1ec45b95e (diff)
parent182925b7c0ef7a1cca7982c1a9e0c81fafa58266 (diff)
Merge pull request #1463 from kuszmaul:indicative
PiperOrigin-RevId: 537078029 Change-Id: Ibf0be0a8e83f62d492e96f1f1ed7839dbde30fae
Diffstat (limited to 'absl/container/internal/raw_hash_set.cc')
-rw-r--r--absl/container/internal/raw_hash_set.cc11
1 files changed, 6 insertions, 5 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<void*>(reinterpret_cast<uintptr_t>(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<void*>(reinterpret_cast<uintptr_t>(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<void*>(reinterpret_cast<uintptr_t>(slot) - slot_size);
}