MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / erase_ne

Method erase_ne

libCacheSim/dataStructure/sparsepp/spp.h:1550–1573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1548public:
1549 template <class twod_iter>
1550 bool erase_ne(allocator_type &alloc, twod_iter &it)
1551 {
1552 assert(_group && it.col_current != ne_end());
1553 size_type offset = (size_type)(it.col_current - ne_begin());
1554 size_type pos = offset_to_pos(offset);
1555
1556 if (_num_items() <= 1)
1557 {
1558 clear(alloc, false);
1559 it.col_current = 0;
1560 }
1561 else
1562 {
1563 _group_erase(alloc, offset);
1564 _decr_num_items();
1565 _bmclear(pos);
1566
1567 // in case _group_erase reallocated the buffer
1568 it.col_current = reinterpret_cast<pointer>(_group) + offset;
1569 }
1570 _bme_set(pos); // remember that this position has been erased
1571 it.advance_past_end();
1572 return true;
1573 }
1574
1575
1576 // This takes the specified elements out of the group. This is

Callers 1

eraseMethod · 0.80

Calls 2

assertFunction · 0.85
advance_past_endMethod · 0.45

Tested by

no test coverage detected