Fix single character string argument
These String literals may be replaced by equivalent character literals, gaining some performance enhancement.
This commit is contained in:
parent
ca60148431
commit
20f18fd5a6
4 changed files with 6 additions and 6 deletions
|
@ -288,7 +288,7 @@ public class TileSourceManager {
|
||||||
String fileName = file.getName();
|
String fileName = file.getName();
|
||||||
if (fileName.endsWith(".tile")) {
|
if (fileName.endsWith(".tile")) {
|
||||||
String substring = fileName.substring(0, fileName.length() - ".tile".length());
|
String substring = fileName.substring(0, fileName.length() - ".tile".length());
|
||||||
int extInt = substring.lastIndexOf(".");
|
int extInt = substring.lastIndexOf('.');
|
||||||
if (extInt != -1) {
|
if (extInt != -1) {
|
||||||
return substring.substring(extInt, substring.length());
|
return substring.substring(extInt, substring.length());
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,8 +206,8 @@ public class GeoIntentActivity extends OsmandListActivity {
|
||||||
int i = q.indexOf(',');
|
int i = q.indexOf(',');
|
||||||
String lat = q.substring(0, i);
|
String lat = q.substring(0, i);
|
||||||
String lon = q.substring(i + 1);
|
String lon = q.substring(i + 1);
|
||||||
if (lat.indexOf(":") != -1) {
|
if (lat.indexOf(':') != -1) {
|
||||||
i = lat.indexOf(":");
|
i = lat.indexOf(':');
|
||||||
lat = lat.substring(i + 1);
|
lat = lat.substring(i + 1);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -265,7 +265,7 @@ public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil {
|
||||||
int i = res.indexOf("new_id=\""); //$NON-NLS-1$
|
int i = res.indexOf("new_id=\""); //$NON-NLS-1$
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
i = i + "new_id=\"".length(); //$NON-NLS-1$
|
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) {
|
if (end > 0) {
|
||||||
newId = Long.parseLong(res.substring(i, end)); // << 1;
|
newId = Long.parseLong(res.substring(i, end)); // << 1;
|
||||||
newN = new Node(n, newId);
|
newN = new Node(n, newId);
|
||||||
|
|
|
@ -66,8 +66,8 @@ public class YandexTrafficAdapter extends MapTileAdapter {
|
||||||
String str = dataStream.toString();
|
String str = dataStream.toString();
|
||||||
// JSONObject json = new JSONObject(str.replace("YMaps.TrafficLoader.onLoad(\"stat\",", "").replace("});", "}"));
|
// JSONObject json = new JSONObject(str.replace("YMaps.TrafficLoader.onLoad(\"stat\",", "").replace("});", "}"));
|
||||||
int start = str.indexOf("timestamp:"); //$NON-NLS-1$
|
int start = str.indexOf("timestamp:"); //$NON-NLS-1$
|
||||||
start = str.indexOf("\"", start) + 1; //$NON-NLS-1$
|
start = str.indexOf('\"', start) + 1; //$NON-NLS-1$
|
||||||
int end = str.indexOf("\"", start); //$NON-NLS-1$
|
int end = str.indexOf('\"', start); //$NON-NLS-1$
|
||||||
// exception case
|
// exception case
|
||||||
if (start < 0 || end < 0) {
|
if (start < 0 || end < 0) {
|
||||||
log.info("Timestamp wasn't updated " + str); //$NON-NLS-1$
|
log.info("Timestamp wasn't updated " + str); //$NON-NLS-1$
|
||||||
|
|
Loading…
Reference in a new issue