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

Function CaseInsensitiveEqual

src/test/util/str.cpp:10–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <string>
9
10bool CaseInsensitiveEqual(const std::string& s1, const std::string& s2)
11{
12 if (s1.size() != s2.size()) return false;
13 for (size_t i = 0; i < s1.size(); ++i) {
14 char c1 = s1[i];
15 if (c1 >= 'A' && c1 <= 'Z') c1 -= ('A' - 'a');
16 char c2 = s2[i];
17 if (c2 >= 'A' && c2 <= 'Z') c2 -= ('A' - 'a');
18 if (c1 != c2) return false;
19 }
20 return true;
21}

Callers 3

BOOST_AUTO_TEST_CASEFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
FUZZ_TARGETFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected