From 20f18fd5a6dd79a17584820632ee9b6ad52e0dac Mon Sep 17 00:00:00 2001 From: "Nelson A. de Oliveira" Date: Fri, 2 Aug 2013 21:17:53 -0300 Subject: [PATCH] Fix single character string argument These String literals may be replaced by equivalent character literals, gaining some performance enhancement. --- OsmAnd-java/src/net/osmand/map/TileSourceManager.java | 2 +- .../net/osmand/plus/activities/search/GeoIntentActivity.java | 4 ++-- .../src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java | 2 +- OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/map/TileSourceManager.java b/OsmAnd-java/src/net/osmand/map/TileSourceManager.java index a7bf075c5f..ddb6c98fee 100644 --- a/OsmAnd-java/src/net/osmand/map/TileSourceManager.java +++ b/OsmAnd-java/src/net/osmand/map/TileSourceManager.java @@ -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()); } diff --git a/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java index 7864964e1e..1f25841d15 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java @@ -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 { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java index d8404959f7..b8b4a97e87 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java @@ -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); diff --git a/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java b/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java index 3d8f5faffa..79235106f4 100644 --- a/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java +++ b/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java @@ -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$