Replace compiler for loops for the hash-table types to simplify code usage

This commit is contained in:
gingerBill
2022-12-09 11:29:28 +00:00
parent ffe953b43d
commit 34a048f7da
18 changed files with 269 additions and 209 deletions

View File

@@ -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;
}