MCPcopy Create free account
hub / github.com/catboost/catboost / NumericStrCmp

Function NumericStrCmp

tools/fix_elf/patch.cpp:63–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63int NumericStrCmp(TStringBuf s1, TStringBuf s2) {
64 while (!s1.empty() || !s2.empty()) {
65 char c1 = *s1.data();
66 char c2 = *s2.data();
67
68 if (isdigit(c1) && isdigit(c2)) {
69 TStringBuf num1, num2;
70 ReadNum(s1, num1);
71 ReadNum(s2, num2);
72
73 int c = FromString<int>(num1) - FromString<int>(num2);
74 if (c) {
75 return c;
76 }
77
78 } else {
79 int c = int(c1) - int(c2);
80 if (c) {
81 return c;
82 }
83 }
84
85 s1.Skip(1);
86 s2.Skip(1);
87 }
88
89 return 0;
90}
91
92class TVernauxCmp {
93public:

Callers 2

operator()Method · 0.85
PatchFunction · 0.85

Calls 4

ReadNumFunction · 0.85
emptyMethod · 0.45
dataMethod · 0.45
SkipMethod · 0.45

Tested by

no test coverage detected