MCPcopy Create free account
hub / github.com/Norbyte/ositools / Add

Method Add

OsiInterface/DivBaseTypes.h:122–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 }
121
122 bool Add(FixedString key, ValueType const & value)
123 {
124 if (!key) return false;
125
126 auto * item = &HashTable[(uint64_t)key.Str % HashSize];
127 while (*item != nullptr) {
128 if (strcmp(key.Str, (*item)->Key.Str) == 0) {
129 (*item)->Value = value;
130 return true;
131 }
132
133 item = &(*item)->Next;
134 }
135
136 auto node = GameAlloc<Node>();
137 node->Next = nullptr;
138 node->Key = key;
139 node->Value = value;
140 *item = node;
141 return true;
142 }
143
144 ValueType * Find(char const * str) const
145 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected