MCPcopy Create free account
hub / github.com/NativeScript/android / shiftDown

Method shiftDown

test-app/runtime/src/main/cpp/robin_hood.h:1396–1414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1394 }
1395
1396 void shiftDown(size_t idx) noexcept(std::is_nothrow_move_assignable<Node>::value) {
1397 // until we find one that is either empty or has zero offset.
1398 // TODO(martinus) we don't need to move everything, just the last one for the same
1399 // bucket.
1400 mKeyVals[idx].destroy(*this);
1401
1402 // until we find one that is either empty or has zero offset.
1403 while (mInfo[idx + 1] >= 2 * mInfoInc) {
1404 ROBIN_HOOD_COUNT(shiftDown)
1405 mInfo[idx] = static_cast<uint8_t>(mInfo[idx + 1] - mInfoInc);
1406 mKeyVals[idx] = std::move(mKeyVals[idx + 1]);
1407 ++idx;
1408 }
1409
1410 mInfo[idx] = 0;
1411 // don't destroy, we've moved it
1412 // mKeyVals[idx].destroy(*this);
1413 mKeyVals[idx].~Node();
1414 }
1415
1416 // copy of find(), except that it returns iterator instead of const_iterator.
1417 template <typename Other>

Callers

nothing calls this directly

Calls 2

~NodeMethod · 0.80
destroyMethod · 0.45

Tested by

no test coverage detected