From 6a72f2943d31d0e5a3ed402b5b769dde17f691f5 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 19 Feb 2020 13:23:14 +0900 Subject: 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 --- .../src/org/eclipse/jgit/transport/BasePackPushConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java') 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 -- cgit v1.2.3