MCPcopy Create free account
hub / github.com/Singular/Singular / remove

Method remove

ppcc/adlib/map.h:269–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267
268template <typename K, typename V>
269bool Map<K, V>::remove(K key) {
270 INIT_HASH_LOOP(key);
271 while (_state[pos] != SLOT_EMPTY) {
272 if (_state[pos] == occ && _cmp(_keys[pos], key) == 0) {
273 memset(_keys + pos, 0, sizeof(K));
274 memset(_values + pos, 0, sizeof(V));
275 _state[pos] = SLOT_DELETED;
276 _count--;
277 _deleted++;
278 if ((_count + _deleted) * 3 / 2 > _size || _deleted >= _count)
279 rebuild();
280 return 1;
281 }
282 pos = next(pos, hash) & mask;
283 }
284 return 0;
285}
286
287template <typename K, typename V>
288bool Map<K, V>::find(K key, V &value) {

Callers

nothing calls this directly

Calls 1

nextFunction · 0.85

Tested by

no test coverage detected