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

Function EqualDescriptor

src/test/descriptor_tests.cpp:50–59  ·  view source on GitHub ↗

Compare two descriptors. If only one of them has a checksum, the checksum is ignored. */

Source from the content-addressed store, hash-verified

48
49/** Compare two descriptors. If only one of them has a checksum, the checksum is ignored. */
50bool EqualDescriptor(std::string a, std::string b)
51{
52 bool a_check = (a.size() > 9 && a[a.size() - 9] == '#');
53 bool b_check = (b.size() > 9 && b[b.size() - 9] == '#');
54 if (a_check != b_check) {
55 if (a_check) a = a.substr(0, a.size() - 9);
56 if (b_check) b = b.substr(0, b.size() - 9);
57 }
58 return a == b;
59}
60
61std::string UseHInsteadOfApostrophe(const std::string& desc)
62{

Callers 1

DoCheckFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected