From 34a048f7daaf93b16ae4121bf5238f9008f3465b Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 9 Dec 2022 11:29:28 +0000 Subject: Replace compiler for loops for the hash-table types to simplify code usage --- src/string_set.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/string_set.cpp') diff --git a/src/string_set.cpp b/src/string_set.cpp index 746ad9529..fce98ec75 100644 --- a/src/string_set.cpp +++ b/src/string_set.cpp @@ -215,3 +215,21 @@ gb_inline void string_set_clear(StringSet *s) { s->hashes.data[i] = MAP_SENTINEL; } } + + + +StringSetEntry *begin(StringSet &m) { + return m.entries.data; +} +StringSetEntry const *begin(StringSet const &m) { + return m.entries.data; +} + + +StringSetEntry *end(StringSet &m) { + return m.entries.data + m.entries.count; +} + +StringSetEntry const *end(StringSet const &m) { + return m.entries.data + m.entries.count; +} \ No newline at end of file -- cgit v1.2.3