MCPcopy Create free account
hub / github.com/VCVRack/Rack / strcasecmp

Function strcasecmp

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

Source from the content-addressed store, hash-verified

285
286
287int strcasecmp(const char* s1, const char* s2) {
288 for (size_t i = 0; s1[i] || s2[i]; i++) {
289 // Cast [-128, -1] char to [128, 255] because negative ints are undefined
290 int c1 = std::tolower((unsigned char) s1[i]);
291 int c2 = std::tolower((unsigned char) s2[i]);
292 if (c1 != c2)
293 return c1 - c2;
294 }
295 return 0;
296}
297
298
299bool CaseInsensitiveCompare::operator()(const std::string& a, const std::string& b) const {

Callers 1

operator()Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected