diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2024-04-27 09:03:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-27 09:03:05 +0100 |
| commit | 5969796fbfaa62ea6aba8f0e3915ab8282bb71b5 (patch) | |
| tree | 55775ab838d39df7b127c3e003b16ca4a59a0d0a /src/docs_writer.cpp | |
| parent | 9d3f835e31c08f40dfd420806942af2b7042f993 (diff) | |
| parent | 652079476489b2539c77824ec2719847f28c352d (diff) | |
Merge pull request #3490 from odin-lang/new-string-map
Change layout of compiler hash map types
Diffstat (limited to 'src/docs_writer.cpp')
| -rw-r--r-- | src/docs_writer.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/docs_writer.cpp b/src/docs_writer.cpp index 9ced78d33..ba71eae4d 100644 --- a/src/docs_writer.cpp +++ b/src/docs_writer.cpp @@ -987,9 +987,8 @@ gb_internal void odin_doc_update_entities(OdinDocWriter *w) { auto entities = array_make<Entity *>(heap_allocator(), 0, w->entity_cache.count); defer (array_free(&entities)); - for (u32 i = 0; i < w->entity_cache.count; i++) { - Entity *e = w->entity_cache.entries[i].key; - array_add(&entities, e); + for (auto const &entry : w->entity_cache) { + array_add(&entities, entry.key); } for (Entity *e : entities) { GB_ASSERT(e != nullptr); @@ -998,9 +997,9 @@ gb_internal void odin_doc_update_entities(OdinDocWriter *w) { } } - for (u32 i = 0; i < w->entity_cache.count; i++) { - Entity *e = w->entity_cache.entries[i].key; - OdinDocEntityIndex entity_index = w->entity_cache.entries[i].value; + for (auto const &entry : w->entity_cache) { + Entity *e = entry.key; + OdinDocEntityIndex entity_index = entry.value; OdinDocTypeIndex type_index = odin_doc_type(w, e->type); OdinDocEntityIndex foreign_library = 0; |