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

Method compare

fdbserver/VersionedBTree.actor.cpp:4212–4232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4210
4211 template <typename StringT>
4212 int compare(const StringT& rhs) const {
4213 auto j = begin();
4214 auto k = rhs.begin();
4215 auto jEnd = end();
4216 auto kEnd = rhs.end();
4217
4218 while (j != jEnd && k != kEnd) {
4219 int cmp = *j - *k;
4220 if (cmp != 0) {
4221 return cmp;
4222 }
4223 }
4224
4225 // If we've reached the end of *this, then values are equal if rhs is also exhausted, otherwise *this is less
4226 // than rhs
4227 if (j == jEnd) {
4228 return k == kEnd ? 0 : -1;
4229 }
4230
4231 return 1;
4232 }
4233};
4234
4235// A BTree node link is a list of LogicalPageID's whose contents should be concatenated together.

Callers

nothing calls this directly

Calls 4

beginFunction · 0.85
endFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected