aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/geopoint
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2012-04-20 15:57:37 +0200
committerSamuel Tardieu <sam@rfc1149.net>2012-04-20 16:08:20 +0200
commit57983a04e198c76cf15f8e9bbf2debc0d07564b9 (patch)
tree792057b8b213a82dfe1035fb3820c43c5529ba1b /main/src/cgeo/geocaching/geopoint
parent70b01595e9f054bceb0d28d3ada958d375c7618b (diff)
downloadcgeo-57983a04e198c76cf15f8e9bbf2debc0d07564b9.zip
cgeo-57983a04e198c76cf15f8e9bbf2debc0d07564b9.tar.gz
cgeo-57983a04e198c76cf15f8e9bbf2debc0d07564b9.tar.bz2
Refactoring: do not get through an extra Geopoint when not required
Diffstat (limited to 'main/src/cgeo/geocaching/geopoint')
-rw-r--r--main/src/cgeo/geocaching/geopoint/Viewport.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/geopoint/Viewport.java b/main/src/cgeo/geocaching/geopoint/Viewport.java
index 5080775..4f70291 100644
--- a/main/src/cgeo/geocaching/geopoint/Viewport.java
+++ b/main/src/cgeo/geocaching/geopoint/Viewport.java
@@ -150,12 +150,11 @@ public class Viewport {
static public Viewport containing(final Set<? extends ICoordinates> points) {
Viewport viewport = null;
for (final ICoordinates point : points) {
- final Geopoint coords = point == null ? null : point.getCoords();
- if (coords != null) {
+ if (point != null) {
if (viewport == null) {
- viewport = new Viewport(coords, coords);
+ viewport = new Viewport(point, point);
} else {
- viewport = viewport.expand(coords);
+ viewport = viewport.expand(point);
}
}
}
@@ -175,4 +174,5 @@ public class Viewport {
public int hashCode() {
return bottomLeft.hashCode() ^ topRight.hashCode();
}
+
}