diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2023-09-15 11:44:09 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2024-02-13 13:50:48 +0100 |
commit | af5d4d37ae3ef6612a7530112d5ff15f6e3f5d8d (patch) | |
tree | 6fddd5718194d47bd6ec510f9d9eb66511ec62e7 | |
parent | 56d040b8c73c224aea19c6930bf0892b5b9aca1c (diff) | |
download | jgit-af5d4d37ae3ef6612a7530112d5ff15f6e3f5d8d.tar.gz jgit-af5d4d37ae3ef6612a7530112d5ff15f6e3f5d8d.zip |
[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
(cherry picked from commit cf5ec856bda907c0537ce5a80246b9ab18195c8b)
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitConfig.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitConfig.java index 6a9b45b065..f701a41d67 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitConfig.java @@ -403,7 +403,7 @@ public class CommitConfig { 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; |