[errorprone] Remove unnecessary comparison

Raised by errorprone:

org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitConfig.java:406: error:
[ComparisonOutOfRange] chars may have a value in the range 0 to 65535;
therefore, this comparison to 0 will always evaluate to true
					if (ch >= 0 && ch < inUse.length) {
					       ^
see https://errorprone.info/bugpattern/ComparisonOutOfRange

Change-Id: I9625aa7894a34dbffd77d39a40c6e285c86b56d5
This commit is contained in:
Matthias Sohn 2023-09-15 11:44:09 +02:00
parent 290902d9f3
commit cf5ec856bd
1 changed files with 1 additions and 1 deletions

View File

@ -403,7 +403,7 @@ public static char determineCommentChar(String text) {
for (int i = 0; i < len; i++) {
char ch = line.charAt(i);
if (!Character.isWhitespace(ch)) {
if (ch >= 0 && ch < inUse.length) {
if (ch < inUse.length) {
inUse[ch] = true;
}
break;