mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
修复CollUtil.lastIndexOf序号错误问题
This commit is contained in:
parent
a60aa0ec47
commit
26e5077181
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
# 5.8.6.M1 (2022-08-16)
|
# 5.8.6.M1 (2022-08-20)
|
||||||
|
|
||||||
### 🐣新特性
|
### 🐣新特性
|
||||||
* 【core 】 CollUtil新增addIfAbsent方法(pr#750@Gitee)
|
* 【core 】 CollUtil新增addIfAbsent方法(pr#750@Gitee)
|
||||||
@ -16,6 +16,7 @@
|
|||||||
* 【core 】 修复RandomUtil#randomString 入参length为负数时报错问题(issue#2515@Github)
|
* 【core 】 修复RandomUtil#randomString 入参length为负数时报错问题(issue#2515@Github)
|
||||||
* 【core 】 修复SecureUtil传入null的key抛出异常问题(pr#2521@Github)
|
* 【core 】 修复SecureUtil传入null的key抛出异常问题(pr#2521@Github)
|
||||||
* 【core 】 修复UrlBuilder的toURI方法将url重复编码(issue#2503@Github)
|
* 【core 】 修复UrlBuilder的toURI方法将url重复编码(issue#2503@Github)
|
||||||
|
* 【core 】 修复CollUtil.lastIndexOf序号错误问题
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -1608,12 +1608,12 @@ public class CollUtil {
|
|||||||
}
|
}
|
||||||
int matchIndex = -1;
|
int matchIndex = -1;
|
||||||
if (isNotEmpty(collection)) {
|
if (isNotEmpty(collection)) {
|
||||||
int index = collection.size();
|
int index = 0;
|
||||||
for (T t : collection) {
|
for (T t : collection) {
|
||||||
if (null == matcher || matcher.match(t)) {
|
if (null == matcher || matcher.match(t)) {
|
||||||
matchIndex = index;
|
matchIndex = index;
|
||||||
}
|
}
|
||||||
index--;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return matchIndex;
|
return matchIndex;
|
||||||
|
Loading…
Reference in New Issue
Block a user