diff options
| author | gingerBill <bill@gingerbill.org> | 2021-11-15 17:26:01 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-11-15 17:26:01 +0000 |
| commit | e814a3693f9efbdd00113de4dd5937acd97bc486 (patch) | |
| tree | ff0534f9609fb8b5726c0933027db9963bb469e4 /src/ptr_set.cpp | |
| parent | f55fc4cd08dba25730fa1c74d31611cf27ef2155 (diff) | |
Improve usage of `file_id`
Diffstat (limited to 'src/ptr_set.cpp')
| -rw-r--r-- | src/ptr_set.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ptr_set.cpp b/src/ptr_set.cpp index 8dd3cb4dc..ca7df3b53 100644 --- a/src/ptr_set.cpp +++ b/src/ptr_set.cpp @@ -24,7 +24,9 @@ template <typename T> void ptr_set_reserve(PtrSet<T> *h, isize cap); template <typename T> void ptr_set_init(PtrSet<T> *s, gbAllocator a, isize capacity) { - capacity = next_pow2_isize(gb_max(16, capacity)); + if (capacity != 0) { + capacity = next_pow2_isize(gb_max(16, capacity)); + } slice_init(&s->hashes, a, capacity); array_init(&s->entries, a, 0, capacity); |