MCPcopy Create free account
hub / github.com/apple/foundationdb / decrement

Method decrement

fdbclient/NativeAPI.actor.cpp:2682–2692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2680}
2681
2682void GetRangeLimits::decrement(VectorRef<KeyValueRef> const& data) {
2683 if (rows != GetRangeLimits::ROW_LIMIT_UNLIMITED) {
2684 ASSERT(data.size() <= rows);
2685 rows -= data.size();
2686 }
2687
2688 minRows = std::max(0, minRows - data.size());
2689
2690 if (bytes != GetRangeLimits::BYTE_LIMIT_UNLIMITED)
2691 bytes = std::max(0, bytes - (int)data.expectedSize() - (8 - (int)sizeof(KeyValueRef)) * data.size());
2692}
2693
2694void GetRangeLimits::decrement(KeyValueRef const& data) {
2695 minRows = std::max(0, minRows - 1);

Calls 2

sizeMethod · 0.45
expectedSizeMethod · 0.45

Tested by 2

getTenantRangeMethod · 0.36