MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / cStringCaseEq

Method cStringCaseEq

src/thundersvm/util/log.cpp:882–899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

880 }
881
882 bool Str::cStringCaseEq(const char* s1, const char* s2) {
883 if (s1 == nullptr && s2 == nullptr) return true;
884 if (s1 == nullptr || s2 == nullptr) return false;
885
886 // With thanks to cygwin for this code
887 int d = 0;
888
889 while (true) {
890 const int c1 = toupper(*s1++);
891 const int c2 = toupper(*s2++);
892
893 if (((d = c1 - c2) != 0) || (c2 == '\0')) {
894 break;
895 }
896 }
897
898 return d == 0;
899 }
900
901 bool Str::contains(const char* str, char c) {
902 for (; *str; ++str) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected