From da37f5424c70aaa5b94a88c237e561fd87fc4f8a Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Mon, 2 Dec 2013 09:46:45 +0100 Subject: [PATCH] Improved the readability of BaseBlock.equals. --- src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java b/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java index 7cd2eecc6..7c9048d64 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java +++ b/src/main/java/com/sk89q/worldedit/blocks/BaseBlock.java @@ -140,7 +140,12 @@ public class BaseBlock extends Block { return false; } - return getType() == ((BaseBlock) o).getType() && getData() == ((BaseBlock) o).getData(); + final BaseBlock otherBlock = (BaseBlock) o; + if (getType() != otherBlock.getType()) { + return false; + } + + return getData() == otherBlock.getData(); } /**