From 6f7d2bae8154ad0e72a5265f434c69f980b1f025 Mon Sep 17 00:00:00 2001 From: Mads Boddum Date: Wed, 7 Oct 2015 22:28:46 +0200 Subject: [PATCH] Removed unnecessary variable declaration from distanceTo in Location --- src/resources/Location.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/resources/Location.java b/src/resources/Location.java index f22500eee..77e4cddd8 100644 --- a/src/resources/Location.java +++ b/src/resources/Location.java @@ -285,10 +285,6 @@ public class Location implements Encodable, Serializable { * @return the distance between {@code this} and destination, which is ALWAYS positive. */ public double distanceTo(Location destination) { - double deltaX = destination.getX() - getX(); - double deltaY = destination.getY() - getY(); - double deltaZ = destination.getZ() - getZ(); - - return Math.sqrt(square(deltaX) + square(deltaY) + square(deltaZ)); + return Math.sqrt(square(destination.getX() - getX()) + square(destination.getY() - getY()) + square(destination.getZ() - getZ())); } }