修复CollUtil.lastIndexOf序号错误问题

This commit is contained in:
Looly
2022-08-20 00:54:22 +08:00
parent a60aa0ec47
commit 26e5077181
2 changed files with 4 additions and 3 deletions

View File

@@ -1608,12 +1608,12 @@ public class CollUtil {
}
int matchIndex = -1;
if (isNotEmpty(collection)) {
int index = collection.size();
int index = 0;
for (T t : collection) {
if (null == matcher || matcher.match(t)) {
matchIndex = index;
}
index--;
index++;
}
}
return matchIndex;