mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
use index of char instead of index of string, if possible
This commit is contained in:
@@ -1089,7 +1089,7 @@ public class RepositoryResource
|
||||
private String getContentDispositionNameFromPath(String path)
|
||||
{
|
||||
String name = path;
|
||||
int index = path.lastIndexOf("/");
|
||||
int index = path.lastIndexOf('/');
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
|
||||
@@ -299,7 +299,7 @@ public class DefaultPluginLoader implements PluginLoader
|
||||
{
|
||||
|
||||
// jar:file:/some/path/file.jar!/META-INF/scm/plugin.xml
|
||||
path = path.substring("jar:file:".length(), path.lastIndexOf("!"));
|
||||
path = path.substring("jar:file:".length(), path.lastIndexOf('!'));
|
||||
path = decodePath(path);
|
||||
}
|
||||
|
||||
|
||||
@@ -673,7 +673,7 @@ public class DefaultPluginManager
|
||||
*/
|
||||
private String getPluginIdPrefix(String pluginId)
|
||||
{
|
||||
return pluginId.substring(0, pluginId.lastIndexOf(":"));
|
||||
return pluginId.substring(0, pluginId.lastIndexOf(':'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -156,7 +156,7 @@ public class TemplateServlet extends HttpServlet
|
||||
params.put("locale", locale);
|
||||
|
||||
String country = locale;
|
||||
int i = country.indexOf("_");
|
||||
int i = country.indexOf('_');
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
|
||||
@@ -158,7 +158,7 @@ public class DefaultCGIExecutor extends AbstractCGIExecutor
|
||||
|
||||
String execCmd = path;
|
||||
|
||||
if ((execCmd.charAt(0) != '"') && (execCmd.indexOf(" ") >= 0))
|
||||
if ((execCmd.charAt(0) != '"') && (execCmd.indexOf(' ') >= 0))
|
||||
{
|
||||
execCmd = "\"".concat(execCmd).concat("\"");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user