From 4890c1ef9c4ae307574ce0b8f76f9b21e3b0a4a1 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Sun, 8 Jan 2012 16:27:15 +0100 Subject: [PATCH] Optimized Vector[2D].containedWithin and Vector.equals slightly. --- src/main/java/com/sk89q/worldedit/Vector.java | 8 ++++---- src/main/java/com/sk89q/worldedit/Vector2D.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/Vector.java b/src/main/java/com/sk89q/worldedit/Vector.java index a1bcd7991..a0c0abb78 100644 --- a/src/main/java/com/sk89q/worldedit/Vector.java +++ b/src/main/java/com/sk89q/worldedit/Vector.java @@ -517,9 +517,9 @@ public class Vector { * @return */ public boolean containedWithin(Vector min, Vector max) { - return x >= min.getX() && x <= max.getX() - && y >= min.getY() && y <= max.getY() - && z >= min.getZ() && z <= max.getZ(); + return x >= min.x && x <= max.x + && y >= min.y && y <= max.y + && z >= min.z && z <= max.z; } /** @@ -679,7 +679,7 @@ public class Vector { } Vector other = (Vector) obj; - return other.getX() == this.x && other.getY() == this.y && other.getZ() == this.z; + return other.x == this.x && other.y == this.y && other.z == this.z; } /** diff --git a/src/main/java/com/sk89q/worldedit/Vector2D.java b/src/main/java/com/sk89q/worldedit/Vector2D.java index 6055d9d8c..9bc8e67d3 100644 --- a/src/main/java/com/sk89q/worldedit/Vector2D.java +++ b/src/main/java/com/sk89q/worldedit/Vector2D.java @@ -456,8 +456,8 @@ public class Vector2D { * @return */ public boolean containedWithin(Vector2D min, Vector2D max) { - return x >= min.getX() && x <= max.getX() - && z >= min.getZ() && z <= max.getZ(); + return x >= min.x && x <= max.x + && z >= min.z && z <= max.z; } /**