MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / remove

Method remove

Kernel/include/hash.h:64–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 }
63
64 T remove(K key){
65 auto& bucket = buckets[hash(key) % bucketCount];
66
67 acquireLock(&lock);
68 for(unsigned i = 0; i < bucket.get_length(); i++){
69 if(bucket[i].key == key){
70 auto pair = bucket.remove_at(i);
71 releaseLock(&lock);
72 return pair.value;
73 }
74 }
75 releaseLock(&lock);
76
77 return T();
78 }
79
80 T get(K key){
81 auto& bucket = buckets[hash(key) % bucketCount];

Callers

nothing calls this directly

Calls 3

hashFunction · 0.85
get_lengthMethod · 0.45
remove_atMethod · 0.45

Tested by

no test coverage detected