aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-11-23 14:34:18 +0100
committerSamuel Tardieu <sam@rfc1149.net>2014-11-23 14:34:18 +0100
commit2ca892ad2e9bd208162fdab5e158d35e661c9e93 (patch)
treed390de3d62269bdc569625b3f94770ca3d8c9ad3
parent847a9777dc1a81b10f456009cee326d47fd3710d (diff)
downloadcgeo-2ca892ad2e9bd208162fdab5e158d35e661c9e93.zip
cgeo-2ca892ad2e9bd208162fdab5e158d35e661c9e93.tar.gz
cgeo-2ca892ad2e9bd208162fdab5e158d35e661c9e93.tar.bz2
Inline once-used short method GeoData.isRecent
-rw-r--r--main/src/cgeo/geocaching/sensors/GeoData.java6
1 files changed, 1 insertions, 5 deletions
diff --git a/main/src/cgeo/geocaching/sensors/GeoData.java b/main/src/cgeo/geocaching/sensors/GeoData.java
index c0618a5..a52eb55 100644
--- a/main/src/cgeo/geocaching/sensors/GeoData.java
+++ b/main/src/cgeo/geocaching/sensors/GeoData.java
@@ -32,7 +32,7 @@ public class GeoData extends Location {
@Nullable
static Location best(@Nullable final Location gpsLocation, @Nullable final Location netLocation) {
- if (isRecent(gpsLocation) || netLocation == null) {
+ if (netLocation == null || (gpsLocation != null && System.currentTimeMillis() <= gpsLocation.getTime() + 30000)) {
return gpsLocation;
}
if (gpsLocation == null) {
@@ -93,8 +93,4 @@ public class GeoData extends Location {
}
}
- public static boolean isRecent(@Nullable final Location location) {
- return location != null && System.currentTimeMillis() <= location.getTime() + 30000;
- }
-
} \ No newline at end of file