MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / strCmp

Function strCmp

Source/3rdParty/bx/src/string.cpp:174–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172
173 template<CharFn fn>
174 inline int32_t strCmp(const char* _lhs, int32_t _lhsMax, const char* _rhs, int32_t _rhsMax)
175 {
176 int32_t max = min(_lhsMax, _rhsMax);
177
178 for (
179 ; 0 < max && fn(*_lhs) == fn(*_rhs)
180 ; ++_lhs, ++_rhs, --max
181 )
182 {
183 if (*_lhs == '\0'
184 || *_rhs == '\0')
185 {
186 break;
187 }
188 }
189
190 if (0 == max)
191 {
192 return _lhsMax == _rhsMax ? 0 : _lhsMax > _rhsMax ? 1 : -1;
193 }
194
195 return fn(*_lhs) - fn(*_rhs);
196 }
197
198 int32_t strCmp(const StringView& _lhs, const StringView& _rhs, int32_t _max)
199 {

Callers 15

imageParseTinyExrFunction · 0.85
toAttribEnumFunction · 0.85
compileFunction · 0.85
toAttribEnumFunction · 0.85
compileFunction · 0.85
interpolationDx11Function · 0.85
compileShaderFunction · 0.85
shaderc_hlsl.cppFile · 0.85
compileFunction · 0.85
updateExtensionFunction · 0.85
initMethod · 0.85

Calls 2

minFunction · 0.50
getLengthMethod · 0.45

Tested by

no test coverage detected