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

Function Reverse

src/leveldb/table/table_test.cc:28–36  ·  view source on GitHub ↗

Return reverse of "key". Used to test non-lexicographic comparators.

Source from the content-addressed store, hash-verified

26// Return reverse of "key".
27// Used to test non-lexicographic comparators.
28static std::string Reverse(const Slice& key) {
29 std::string str(key.ToString());
30 std::string rev("");
31 for (std::string::reverse_iterator rit = str.rbegin(); rit != str.rend();
32 ++rit) {
33 rev.push_back(*rit);
34 }
35 return rev;
36}
37
38namespace {
39class ReverseKeyComparator : public Comparator {

Callers 4

CompareMethod · 0.85
FindShortestSeparatorMethod · 0.85
FindShortSuccessorMethod · 0.85
IncrementFunction · 0.85

Calls 4

rbeginMethod · 0.80
rendMethod · 0.80
ToStringMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected