mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-24 18:04:54 +08:00
fix code
This commit is contained in:
parent
305fa44b55
commit
cf51559876
@ -48,9 +48,13 @@ public abstract class TextFinder implements Finder, Serializable {
|
||||
* @return 有效结束位置
|
||||
*/
|
||||
protected int getValidEndIndex(boolean negative) {
|
||||
if(negative && -1 == endIndex){
|
||||
// 反向查找模式下,-1表示0前面的位置,即字符串反向末尾的位置
|
||||
return -1;
|
||||
}
|
||||
final int limit;
|
||||
if (endIndex < 0) {
|
||||
limit = negative ? -1 : text.length();
|
||||
limit = endIndex + text.length();
|
||||
} else {
|
||||
limit = Math.min(endIndex, text.length());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user