diff options
| author | gingerBill <bill@gingerbill.org> | 2022-12-09 11:29:28 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-12-09 11:29:28 +0000 |
| commit | 34a048f7daaf93b16ae4121bf5238f9008f3465b (patch) | |
| tree | 3857fdc80f73522a8b2af265f257a4decd447afd /src/ptr_set.cpp | |
| parent | ffe953b43d1ad31d2c37f544a1d389e30d8f69bf (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.cpp | 21 |
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 |