Fix: String function use should be optimized for single characters (squid:S3027)

This commit is contained in:
Jano Svitok 2018-07-30 12:15:04 +02:00
parent 23b4dd6b4d
commit 9b6074ce2d
2 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ class HostConnectToRemoteTcpDevice {
} }
private String extractError(String response) { private String extractError(String response) {
int lastColon = response.lastIndexOf(":"); int lastColon = response.lastIndexOf(':');
if (lastColon != -1) { if (lastColon != -1) {
return response.substring(lastColon, response.length()); return response.substring(lastColon, response.length());
} else { } else {

View File

@ -63,7 +63,7 @@ public class HostDisconnectFromRemoteTcpDevice {
} }
private String extractError(String response) { private String extractError(String response) {
int lastColon = response.lastIndexOf(":"); int lastColon = response.lastIndexOf(':');
if (lastColon != -1) { if (lastColon != -1) {
return response.substring(lastColon, response.length()); return response.substring(lastColon, response.length());
} else { } else {