mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-06 01:58:24 +00:00
Refactor magic number into constant.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1586293 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4eb70a5f43
commit
3efd6ccdbf
@ -26,6 +26,8 @@
|
||||
*/
|
||||
public class CharSequenceUtils {
|
||||
|
||||
private static final int NOT_FOUND = -1;
|
||||
|
||||
/**
|
||||
* <p>{@code CharSequenceUtils} instances should NOT be constructed in
|
||||
* standard programming. </p>
|
||||
@ -79,7 +81,7 @@ static int indexOf(final CharSequence cs, final int searchChar, int start) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return NOT_FOUND;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -118,7 +120,7 @@ static int lastIndexOf(final CharSequence cs, final int searchChar, int start) {
|
||||
}
|
||||
final int sz = cs.length();
|
||||
if (start < 0) {
|
||||
return -1;
|
||||
return NOT_FOUND;
|
||||
}
|
||||
if (start >= sz) {
|
||||
start = sz - 1;
|
||||
@ -128,7 +130,7 @@ static int lastIndexOf(final CharSequence cs, final int searchChar, int start) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return NOT_FOUND;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user