single-char indexof()

This commit is contained in:
zzz
2017-02-04 19:46:04 +00:00
parent 82d812c25c
commit 6306799a4b

View File

@ -432,8 +432,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
// Deprecated // Deprecated
// /eepproxy/foo.i2p/bar/baz.html // /eepproxy/foo.i2p/bar/baz.html
String subRequest = request.substring("/eepproxy/".length()); String subRequest = request.substring("/eepproxy/".length());
if(subRequest.indexOf("/") == -1) { if(subRequest.indexOf('/') == -1) {
subRequest += "/"; subRequest += '/';
} }
request = "http://" + subRequest; request = "http://" + subRequest;
/**** /****
@ -537,10 +537,10 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
} else if(hostLowerCase.equals("i2p")) { } else if(hostLowerCase.equals("i2p")) {
// pull the b64 _dest out of the first path element // pull the b64 _dest out of the first path element
String oldPath = requestURI.getPath().substring(1); String oldPath = requestURI.getPath().substring(1);
int slash = oldPath.indexOf("/"); int slash = oldPath.indexOf('/');
if(slash < 0) { if(slash < 0) {
slash = oldPath.length(); slash = oldPath.length();
oldPath += "/"; oldPath += '/';
} }
String _dest = oldPath.substring(0, slash); String _dest = oldPath.substring(0, slash);
if(slash >= 516 && !_dest.contains(".")) { if(slash >= 516 && !_dest.contains(".")) {