mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-09 06:23:14 +00:00
Replace compiler for loops for the hash-table types to simplify code usage
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user