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

Method modify

fdbclient/include/fdbclient/KeyRangeMap.h:54–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52 std::vector<KeyRangeWith<Val>> getAffectedRangesAfterInsertion(const KeyRangeRef& keys,
53 const Val& insertionValue = Val());
54 typename RangeMap<Key, Val, KeyRangeRef, Metric, MetricFunc>::Ranges modify(
55 const KeyRangeRef&
56 keys) // Returns ranges, the first of which begins at keys.begin and the last of which ends at keys.end
57 {
58 MapPair<Key, Val> valueBeforeRange(
59 keys.begin, RangeMap<Key, Val, KeyRangeRef, Metric>::rangeContaining(keys.begin).value());
60 MapPair<Key, Val> valueAfterRange(keys.end,
61 RangeMap<Key, Val, KeyRangeRef, Metric>::rangeContaining(keys.end).value());
62
63 RangeMap<Key, Val, KeyRangeRef, Metric, MetricFunc>::map.insert(std::move(valueBeforeRange));
64 RangeMap<Key, Val, KeyRangeRef, Metric, MetricFunc>::map.insert(std::move(valueAfterRange));
65 return RangeMap<Key, Val, KeyRangeRef, Metric, MetricFunc>::intersectingRanges(keys);
66 }
67
68 void rawErase(KeyRange const& range) {
69 RangeMap<Key, Val, KeyRangeRef, Metric, MetricFunc>::map.erase(

Calls 3

moveFunction · 0.85
valueMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected