MCPcopy Create free account
hub / github.com/apache/trafficserver / erase

Method erase

lib/swoc/include/swoc/IntrusiveHashMap.h:543–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

541
542template <typename H>
543auto
544IntrusiveHashMap<H>::erase(iterator const &loc) -> iterator {
545 value_type *v = loc;
546 iterator zret = ++(this->iterator_for(v)); // get around no const_iterator -> iterator.
547 Bucket *b = this->bucket_for(H::key_of(v));
548 value_type *nv = H::next_ptr(v);
549 value_type *limit = b->limit();
550 if (b->_v == v) { // removed first element in bucket, update bucket
551 if (limit == nv) { // that was also the only element, deactivate bucket
552 _active_buckets.erase(b);
553 b->clear();
554 } else {
555 b->_v = nv;
556 --b->_count;
557 }
558 }
559 _list.erase(loc);
560 return zret;
561}
562
563template <typename H>
564bool

Callers

nothing calls this directly

Calls 6

iterator_forMethod · 0.95
bucket_forMethod · 0.95
findMethod · 0.95
limitMethod · 0.45
clearMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected