diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2012-04-20 20:16:40 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2012-04-20 22:14:19 +0200 |
| commit | b9b297a38accdd54641b325ece04f488bbf90fb8 (patch) | |
| tree | 5ab47eb0f713148a86a03d7c14ee2223acbfb396 /main/src/cgeo/geocaching/maps/CGeoMap.java | |
| parent | c91a817d13a8f68cc5b7399ba4cbe7cd16a4645b (diff) | |
| download | cgeo-b9b297a38accdd54641b325ece04f488bbf90fb8.zip cgeo-b9b297a38accdd54641b325ece04f488bbf90fb8.tar.gz cgeo-b9b297a38accdd54641b325ece04f488bbf90fb8.tar.bz2 | |
Refactoring: cleanup control flow
Diffstat (limited to 'main/src/cgeo/geocaching/maps/CGeoMap.java')
| -rw-r--r-- | main/src/cgeo/geocaching/maps/CGeoMap.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java index 7c70266..42f12a9 100644 --- a/main/src/cgeo/geocaching/maps/CGeoMap.java +++ b/main/src/cgeo/geocaching/maps/CGeoMap.java @@ -876,17 +876,17 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto * @return the current map state as an array of int, or null if no map state is available */ private int[] currentMapState() { - if (mapView != null) { - int[] mapState = new int[4]; - GeoPointImpl mapCenter = mapView.getMapViewCenter(); - mapState[0] = mapCenter.getLatitudeE6(); - mapState[1] = mapCenter.getLongitudeE6(); - mapState[2] = mapView.getMapZoomLevel(); - mapState[3] = followMyLocation ? 1 : 0; - return mapState; - } else { + if (mapView == null) { return mapStateIntent; } + + final GeoPointImpl mapCenter = mapView.getMapViewCenter(); + return new int[] { + mapCenter.getLatitudeE6(), + mapCenter.getLongitudeE6(), + mapView.getMapZoomLevel(), + followMyLocation ? 1 : 0 + }; } private void savePrefs() { |
