aboutsummaryrefslogtreecommitdiff
path: root/src/ptr_set.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-12-09 11:29:28 +0000
committergingerBill <bill@gingerbill.org>2022-12-09 11:29:28 +0000
commit34a048f7daaf93b16ae4121bf5238f9008f3465b (patch)
tree3857fdc80f73522a8b2af265f257a4decd447afd /src/ptr_set.cpp
parentffe953b43d1ad31d2c37f544a1d389e30d8f69bf (diff)
Replace compiler for loops for the hash-table types to simplify code usage
Diffstat (limited to 'src/ptr_set.cpp')
-rw-r--r--src/ptr_set.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ptr_set.cpp b/src/ptr_set.cpp
index ffe48d69a..04ce162e2 100644
--- a/src/ptr_set.cpp
+++ b/src/ptr_set.cpp
@@ -233,3 +233,24 @@ gb_inline void ptr_set_clear(PtrSet<T> *s) {
s->hashes.data[i] = MAP_SENTINEL;
}
}
+
+
+template <typename T>
+PtrSetEntry<T> *begin(PtrSet<T> &m) {
+ return m.entries.data;
+}
+template <typename T>
+PtrSetEntry<T> const *begin(PtrSet<T> const &m) {
+ return m.entries.data;
+}
+
+
+template <typename T>
+PtrSetEntry<T> *end(PtrSet<T> &m) {
+ return m.entries.data + m.entries.count;
+}
+
+template <typename T>
+PtrSetEntry<T> const *end(PtrSet<T> const &m) {
+ return m.entries.data + m.entries.count;
+} \ No newline at end of file