aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2020-02-19 13:23:14 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2020-02-19 13:24:01 +0900
commit6a72f2943d31d0e5a3ed402b5b769dde17f691f5 (patch)
tree882788047acee782705752ab0124b74fa3b930a1 /org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
parent064834d350d38f672a69947cf924f56d52bd1274 (diff)
downloadjgit-6a72f2943d31d0e5a3ed402b5b769dde17f691f5.tar.gz
jgit-6a72f2943d31d0e5a3ed402b5b769dde17f691f5.zip
Use indexOf(char) and lastIndexOf(char) rather than String versions
An indexOf or lastIndexOf call with a single letter String can be made more performant by switching to a call with a char argument. Found with SonarLint. As a side-effect of this change, we no longer need to suppress the NON-NLS warnings. Change-Id: Id44cb996bb74ed30edd560aa91fd8525aafdc8dd Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
index 35ea35ecb8..12ade4d195 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
@@ -391,7 +391,7 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen
refNameEnd = refLine.length();
} else if (refLine.startsWith("ng ")) { //$NON-NLS-1$
ok = false;
- refNameEnd = refLine.indexOf(" ", 3); //$NON-NLS-1$
+ refNameEnd = refLine.indexOf(' ', 3);
}
if (refNameEnd == -1)
throw new PackProtocolException(MessageFormat.format(JGitText.get().unexpectedReportLine2