mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Minor fixes.
This commit is contained in:
@@ -52,6 +52,14 @@ macro void printf_register_to_string($Type)
|
||||
printf_register($Type.typeid, (PrintFunction)&$Type.to_string);
|
||||
}
|
||||
|
||||
static initialize @priority(101)
|
||||
{
|
||||
if (!print_functions.table.len)
|
||||
{
|
||||
print_functions.init(512);
|
||||
}
|
||||
}
|
||||
|
||||
fn void printf_register(typeid type, PrintFunction function)
|
||||
{
|
||||
if (!print_functions.table.len)
|
||||
|
||||
@@ -50,6 +50,7 @@ fn bool HashMap.is_empty(HashMap* map) @inline
|
||||
|
||||
fn Value*! HashMap.get_ref(HashMap* map, Key key)
|
||||
{
|
||||
if (!map.count) return SearchResult.MISSING!;
|
||||
uint hash = rehash(key.hash());
|
||||
for (Entry *e = map.table[index_for(hash, map.table.len)]; e != null; e = e.next)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user