MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / CaseInsensitiveStringEquals

Function CaseInsensitiveStringEquals

oneflow/core/common/util.cpp:116–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114namespace {
115
116bool CaseInsensitiveStringEquals(const std::string& lhs, const std::string& rhs) {
117 return lhs.size() == rhs.size()
118 && std::equal(lhs.begin(), lhs.end(), rhs.begin(),
119 [](char a, char b) { return std::tolower(a) == std::tolower(b); });
120}
121
122bool StringToBool(const std::string& str) {
123 return CaseInsensitiveStringEquals(str, "1") || CaseInsensitiveStringEquals(str, "true")

Callers 1

StringToBoolFunction · 0.85

Calls 3

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected