fix erors
This commit is contained in:
parent
7781744031
commit
73e8322f85
10
util.d
10
util.d
@ -377,7 +377,7 @@ Push(K, V)(HashTable!(K, V)* ht, K key, V value)
|
|||||||
|
|
||||||
if (ht.free_lists.first != ht.nil)
|
if (ht.free_lists.first != ht.nil)
|
||||||
{
|
{
|
||||||
node = Pop(&ht.free_lists, ht.nil);
|
node = SLLPop(&ht.free_lists, ht.nil);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -388,7 +388,7 @@ Push(K, V)(HashTable!(K, V)* ht, K key, V value)
|
|||||||
node.value.key = key;
|
node.value.key = key;
|
||||||
node.value.value = value;
|
node.value.value = value;
|
||||||
|
|
||||||
Push(GetList(ht, key), node, ht.nil);
|
SLLPush(GetList(ht, key), node, ht.nil);
|
||||||
|
|
||||||
ht.node_count += 1;
|
ht.node_count += 1;
|
||||||
|
|
||||||
@ -928,4 +928,10 @@ unittest
|
|||||||
|
|
||||||
assert(test_bytes[0 .. 96] == bytes[0 .. 96]);
|
assert(test_bytes[0 .. 96] == bytes[0 .. 96]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ // Hash Table
|
||||||
|
auto table = CreateHashTable!(u64, u64)(10);
|
||||||
|
|
||||||
|
table[100] = 100;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user