MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / set

Method set

source/util/bhashtable.h:302–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300 }
301
302 Value set(const Key& key, const Value& value) requires (concepts::has_arrow_operator<Value> || std::is_pointer_v<Value>) {
303 // if the key is already in the table, just replace it and move on
304 if (Slot* slot = get_slot(key)) {
305 Value oldValue = slot->kv.value;
306 slot->kv.value = value;
307 return oldValue;
308 }
309
310 // else we need to insert it. First, check if we need to expand.
311 if (should_rehash()) {
312 rehash();
313 }
314
315 // then we actually insert the key.
316 insert_nonexistent_norehash(key, std::move(value));
317 return nullptr;
318 }
319
320 bool set(const Key& key, const Value& value) requires (!concepts::has_arrow_operator<Value> && !std::is_pointer_v<Value>) {
321 // if the key is already in the table, just replace it and move on

Callers 7

getIconTextureMethod · 0.45
ConfigFileMethod · 0.45
writeStringMethod · 0.45
writeBoolMethod · 0.45
writeIntMethod · 0.45
allocMethod · 0.45
freeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected