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

Method setKey

fdbclient/FDBTypes.cpp:43–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void KeySelectorRef::setKey(KeyRef const& key) {
44 // There are no keys in the database with size greater than the max key size, so if this key selector has a key
45 // which is large, then we can translate it to an equivalent key selector with a smaller key
46 int64_t maxKeySize = getMaxKeySize(key);
47 if (key.size() > maxKeySize) {
48 this->key = key.substr(0, maxKeySize + 1);
49 } else {
50 this->key = key;
51 }
52}
53
54void KeySelectorRef::setKeyUnlimited(KeyRef const& key) {
55 this->key = key;

Calls 3

getMaxKeySizeFunction · 0.85
substrMethod · 0.80
sizeMethod · 0.45