diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2011-09-28 21:59:34 +0200 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2011-09-29 09:35:48 +0200 |
commit | f68241ae27eab529b97faef405b4a3a00c35b4c5 (patch) | |
tree | a5b8b5d9941c014f64a5a252134cddb44c05c588 /main/src/cgeo/geocaching/cgData.java | |
parent | fe34a5bd488c1b896f354f9d7ae322a8a7097a99 (diff) | |
download | cgeo-f68241ae27eab529b97faef405b4a3a00c35b4c5.zip cgeo-f68241ae27eab529b97faef405b4a3a00c35b4c5.tar.gz cgeo-f68241ae27eab529b97faef405b4a3a00c35b4c5.tar.bz2 |
Make parameters read-only
Diffstat (limited to 'main/src/cgeo/geocaching/cgData.java')
-rw-r--r-- | main/src/cgeo/geocaching/cgData.java | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/main/src/cgeo/geocaching/cgData.java b/main/src/cgeo/geocaching/cgData.java index e01152d..c1b0082 100644 --- a/main/src/cgeo/geocaching/cgData.java +++ b/main/src/cgeo/geocaching/cgData.java @@ -2585,19 +2585,15 @@ public class cgData { return count; } - public List<String> loadBatchOfStoredGeocodes(boolean detailedOnly, final Geopoint coords, String cachetype, int list) { + public List<String> loadBatchOfStoredGeocodes(final boolean detailedOnly, final Geopoint coords, final String cachetype, final int list) { init(); - if (list < 1) { - list = 1; - } - List<String> geocodes = new ArrayList<String>(); StringBuilder specifySql = new StringBuilder(); specifySql.append("reason = "); - specifySql.append(list); + specifySql.append(Math.max(list, 1)); if (detailedOnly) { specifySql.append(" and detailed = 1 "); @@ -2836,19 +2832,15 @@ public class cgData { return geocodes; } - public void markStored(String geocode, int listId) { + public void markStored(final String geocode, final int listId) { if (StringUtils.isBlank(geocode)) { return; } init(); - if (listId <= 0) { - listId = 1; - } - ContentValues values = new ContentValues(); - values.put("reason", listId); + values.put("reason", Math.max(listId, 1)); databaseRW.update(dbTableCaches, values, "geocode = ? and reason < 1", new String[] { geocode }); } |