MCPcopy Create free account
hub / github.com/ElementsProject/elements / FindLargestKey

Function FindLargestKey

src/leveldb/db/version_set.cc:1303–1317  ·  view source on GitHub ↗

Finds the largest key in a vector of files. Returns true if files it not empty.

Source from the content-addressed store, hash-verified

1301// Finds the largest key in a vector of files. Returns true if files it not
1302// empty.
1303bool FindLargestKey(const InternalKeyComparator& icmp,
1304 const std::vector<FileMetaData*>& files,
1305 InternalKey* largest_key) {
1306 if (files.empty()) {
1307 return false;
1308 }
1309 *largest_key = files[0]->largest;
1310 for (size_t i = 1; i < files.size(); ++i) {
1311 FileMetaData* f = files[i];
1312 if (icmp.Compare(f->largest, *largest_key) > 0) {
1313 *largest_key = f->largest;
1314 }
1315 }
1316 return true;
1317}
1318
1319// Finds minimum file b2=(l2, u2) in level file for which l2 > u1 and
1320// user_key(l2) = user_key(u1)

Callers 1

AddBoundaryInputsFunction · 0.85

Calls 3

emptyMethod · 0.45
sizeMethod · 0.45
CompareMethod · 0.45

Tested by

no test coverage detected