Clean up single char indexOf()

This commit is contained in:
zzz
2016-12-02 18:52:37 +00:00
parent 5b31540fe8
commit 5be077e25d
29 changed files with 51 additions and 51 deletions

View File

@ -958,7 +958,7 @@ public class TrackerClient implements Runnable {
{
announce = a;
String s = a.substring(7);
host = s.substring(0, s.indexOf("/"));
host = s.substring(0, s.indexOf('/'));
isPrimary = p;
interval = INITIAL_SLEEP;
}

View File

@ -1466,7 +1466,7 @@ public class I2PSnarkServlet extends BasicServlet {
String fullBasename = basename;
if (basename.length() > MAX_DISPLAYED_FILENAME_LENGTH) {
String start = basename.substring(0, MAX_DISPLAYED_FILENAME_LENGTH);
if (start.indexOf(" ") < 0 && start.indexOf("-") < 0) {
if (start.indexOf(' ') < 0 && start.indexOf('-') < 0) {
// browser has nowhere to break it
basename = start + HELLIP;
}
@ -3086,7 +3086,7 @@ public class I2PSnarkServlet extends BasicServlet {
: tx + ": " + directory);
if (showSort)
buf.append("</a>");
int dirSlash = directory.indexOf("/");
int dirSlash = directory.indexOf('/');
if (dirSlash > 0) {
buf.append("&nbsp;");
buf.append(DataHelper.escapeHTML(directory.substring(dirSlash + 1)));

View File

@ -96,7 +96,7 @@ public class InclusiveByteRange
long first = -1;
long last = -1;
int d = t.indexOf('-');
if (d < 0 || t.indexOf("-",d + 1) >= 0)
if (d < 0 || t.indexOf('-',d + 1) >= 0)
{
if ("bytes".equals(t))
continue;

View File

@ -105,7 +105,7 @@ class MimeTypes
int i=-1;
while(type==null)
{
i=filename.indexOf(".",i+1);
i=filename.indexOf('.',i+1);
if (i<0 || i>=filename.length())
break;