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

Function isShorterPrefixOfCaseInsensitive

src/utils/string.cpp:302–306  ·  view source on GitHub ↗

* @brief Checks if the shorter string of @a str1 and @a str2 is a * case-insensitive prefix of the longer string. */

Source from the content-addressed store, hash-verified

300* case-insensitive prefix of the longer string.
301*/
302bool isShorterPrefixOfCaseInsensitive(const std::string &str1,
303 const std::string &str2) {
304 const auto minLen = std::min(str1.length(), str2.length());
305 return areEqualCaseInsensitive(str1.substr(0, minLen), str2.substr(0, minLen));
306}
307
308/**
309* @brief Checks if @a str contains @a sub.

Callers 1

compareForSortFunction · 0.85

Calls 2

areEqualCaseInsensitiveFunction · 0.85
lengthMethod · 0.80

Tested by

no test coverage detected