MCPcopy Create free account
hub / github.com/cuberite/cuberite / RateCompareString

Function RateCompareString

src/StringUtils.cpp:250–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248
249
250unsigned int RateCompareString(const AString & s1, const AString & s2 )
251{
252 unsigned int MatchedLetters = 0;
253 unsigned int s1Length = s1.length();
254
255 if( s1Length > s2.length() ) return 0; // Definitely not a match
256
257 for (unsigned int i = 0; i < s1Length; i++)
258 {
259 char c1 = (char)toupper( s1[i] );
260 char c2 = (char)toupper( s2[i] );
261 if( c1 == c2 )
262 {
263 ++MatchedLetters;
264 }
265 else
266 {
267 break;
268 }
269 }
270 return MatchedLetters;
271}
272
273
274

Callers 2

ItemMethod · 0.85
FindAndDoWithPlayerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected