Fix single character string argument

These String literals may be replaced by equivalent character literals,
gaining some performance enhancement.
This commit is contained in:
Nelson A. de Oliveira 2013-08-02 21:17:53 -03:00
parent ca60148431
commit 20f18fd5a6
4 changed files with 6 additions and 6 deletions

View file

@ -288,7 +288,7 @@ public class TileSourceManager {
String fileName = file.getName();
if (fileName.endsWith(".tile")) {
String substring = fileName.substring(0, fileName.length() - ".tile".length());
int extInt = substring.lastIndexOf(".");
int extInt = substring.lastIndexOf('.');
if (extInt != -1) {
return substring.substring(extInt, substring.length());
}

View file

@ -206,8 +206,8 @@ public class GeoIntentActivity extends OsmandListActivity {
int i = q.indexOf(',');
String lat = q.substring(0, i);
String lon = q.substring(i + 1);
if (lat.indexOf(":") != -1) {
i = lat.indexOf(":");
if (lat.indexOf(':') != -1) {
i = lat.indexOf(':');
lat = lat.substring(i + 1);
}
try {

View file

@ -265,7 +265,7 @@ public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil {
int i = res.indexOf("new_id=\""); //$NON-NLS-1$
if (i > 0) {
i = i + "new_id=\"".length(); //$NON-NLS-1$
int end = res.indexOf("\"", i); //$NON-NLS-1$
int end = res.indexOf('\"', i); //$NON-NLS-1$
if (end > 0) {
newId = Long.parseLong(res.substring(i, end)); // << 1;
newN = new Node(n, newId);

View file

@ -66,8 +66,8 @@ public class YandexTrafficAdapter extends MapTileAdapter {
String str = dataStream.toString();
// JSONObject json = new JSONObject(str.replace("YMaps.TrafficLoader.onLoad(\"stat\",", "").replace("});", "}"));
int start = str.indexOf("timestamp:"); //$NON-NLS-1$
start = str.indexOf("\"", start) + 1; //$NON-NLS-1$
int end = str.indexOf("\"", start); //$NON-NLS-1$
start = str.indexOf('\"', start) + 1; //$NON-NLS-1$
int end = str.indexOf('\"', start); //$NON-NLS-1$
// exception case
if (start < 0 || end < 0) {
log.info("Timestamp wasn't updated " + str); //$NON-NLS-1$