MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / AddPairToHash

Function AddPairToHash

Source/UserInput/keycommands.cpp:259–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259void AddPairToHash(const char* cstr, int id) {
260 hash_to_command.resize(hash_to_command.size() + 1);
261 HashInt& new_pair = hash_to_command.back();
262 new_pair.first = djb2_string_hash(cstr);
263 new_pair.second = id;
264}
265
266int CommandLengthCompare(const void* a, const void* b) {
267 return (*((Command**)b))->num_key_events - (*((Command**)a))->num_key_events;

Callers 1

InitializeMethod · 0.85

Calls 4

djb2_string_hashFunction · 0.85
resizeMethod · 0.45
sizeMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected