From 57983a04e198c76cf15f8e9bbf2debc0d07564b9 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Fri, 20 Apr 2012 15:57:37 +0200 Subject: Refactoring: do not get through an extra Geopoint when not required --- main/src/cgeo/geocaching/geopoint/Viewport.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main/src/cgeo/geocaching/geopoint') 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 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(); } + } -- cgit v1.1