| 1334 | |
| 1335 | template<typename T> |
| 1336 | static 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 |