… | |
… | |
32 | |
32 | |
33 | archetype *loading_arch; // ugly flag to object loader etc. to suppress/request special processing |
33 | archetype *loading_arch; // ugly flag to object loader etc. to suppress/request special processing |
34 | arch_ptr archetype::empty; |
34 | arch_ptr archetype::empty; |
35 | |
35 | |
36 | // the hashtable |
36 | // the hashtable |
37 | typedef ska::flat_hash_map< |
37 | typedef ska::flat_hash_map |
|
|
38 | < |
38 | const char *, |
39 | const char *, |
39 | arch_ptr, |
40 | arch_ptr, |
40 | str_hash, |
41 | str_hash, |
41 | str_equal, |
42 | str_equal, |
42 | slice_allocator< std::pair<const char *const, arch_ptr> > |
43 | slice_allocator< std::pair<const char *const, arch_ptr> > |
43 | > HT; |
44 | > HT; |
44 | |
45 | |
45 | static HT ht (10000); |
46 | static HT ht (10000); |
46 | archvec archetypes; |
47 | archvec archetypes; |
47 | static unordered_vector<archetype *> allarch; |
48 | static unordered_vector<archetype *> allarch; |
48 | static int dirtycnt; |
49 | static int dirtycnt; |
… | |
… | |
346 | archetype::find (const char *name) |
347 | archetype::find (const char *name) |
347 | { |
348 | { |
348 | if (!name) |
349 | if (!name) |
349 | return 0; |
350 | return 0; |
350 | |
351 | |
351 | auto (i, ht.find (name)); |
352 | auto i = ht.find (name); |
352 | |
353 | |
353 | if (i == ht.end ()) |
354 | if (i == ht.end ()) |
354 | return 0; |
355 | return 0; |
355 | else |
356 | else |
356 | return i->second; |
357 | return i->second; |