MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / String_Compare

Function String_Compare

src/String.c:408–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408int String_Compare(const cc_string* a, const cc_string* b) {
409 char aCur, bCur;
410 int i, minLen = min(a->length, b->length);
411
412 for (i = 0; i < minLen; i++) {
413 aCur = a->buffer[i]; Char_MakeLower(aCur);
414 bCur = b->buffer[i]; Char_MakeLower(bCur);
415
416 if (aCur == bCur) continue;
417 return (cc_uint8)aCur - (cc_uint8)bCur;
418 }
419
420 /* all chars are equal here - same string, or a substring */
421 return a->length - b->length;
422}
423
424void String_Format1(cc_string* str, const char* format, const void* a1) {
425 String_Format4(str, format, a1, NULL, NULL, NULL);

Callers 5

NameColumn_SortFunction · 0.85
SoftwareColumn_SortFunction · 0.85
StringsBuffer_QuickSortFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected