MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / remove

Method remove

Utils/Hashmap.h:133–146  ·  view source on GitHub ↗

Remove the given element and return true, if the element was found. */

Source from the content-addressed store, hash-verified

131 /** Remove the given element and return true, if the element was found.
132 */
133 FORCE_INLINE void remove(const KeyType &key)
134 {
135 const unsigned int hashValue = hashFunction<KeyType>(key);
136 const unsigned int mapIndex = hashValue & m_moduloValue;
137 if (m_hashMap[mapIndex] != NULL)
138 {
139 m_hashMap[mapIndex]->erase(hashValue);
140 if (m_hashMap[mapIndex]->size() == 0)
141 {
142 delete m_hashMap[mapIndex];
143 m_hashMap[mapIndex] = NULL;
144 }
145 }
146 }
147
148 FORCE_INLINE ValueType& operator[](const KeyType &key)
149 {

Callers

nothing calls this directly

Calls 2

eraseMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected