MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / TLastIndexOf

Function TLastIndexOf

src/String.cpp:1336–1358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1334
1335template<typename T>
1336static int TLastIndexOf(int s, const T *str, int strLen, const T *sought, int soughtLen)
1337{
1338 if (soughtLen==1)
1339 {
1340 T test = *sought;
1341 while(s>=0)
1342 {
1343 if (str[s]==test)
1344 return s;
1345 s--;
1346 }
1347 }
1348 else
1349 {
1350 while(s>=0)
1351 {
1352 if (!memcmp(str + s,sought,soughtLen*sizeof(T)))
1353 return s;
1354 --s;
1355 }
1356 }
1357 return -1;
1358}
1359
1360
1361

Callers 1

lastIndexOfMethod · 0.85

Calls 1

memcmpFunction · 0.50

Tested by

no test coverage detected