MCPcopy Create free account
hub / github.com/avast/retdec / areEqualCaseInsensitive

Function areEqualCaseInsensitive

src/utils/string.cpp:283–296  ·  view source on GitHub ↗

* @brief Checks if str1 == str2 (case-insensitively). */

Source from the content-addressed store, hash-verified

281* @brief Checks if <tt>str1 == str2</tt> (case-insensitively).
282*/
283bool areEqualCaseInsensitive(const std::string &str1, const std::string &str2) {
284 if (str1.size() != str2.size()) {
285 return false;
286 }
287
288 for (std::string::size_type i = 0, e = str1.size(); i < e; ++i) {
289 const unsigned char lc = str1[i];
290 const unsigned char rc = str2[i];
291 if (std::tolower(lc) != std::tolower(rc)) {
292 return false;
293 }
294 }
295 return true;
296}
297
298/**
299* @brief Checks if the shorter string of @a str1 and @a str2 is a

Callers 7

ordLookUpFunction · 0.85
matchingPluginsMethod · 0.85
metaToStrengthFunction · 0.85
TEST_FFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.68