From d006506531bfb6e32746ffa29e2f220f661aec68 Mon Sep 17 00:00:00 2001 From: ctingue Date: Fri, 11 Mar 2016 13:35:04 -0800 Subject: [PATCH] Drop unnecessary typecast in CidrAddressBlock ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=117002905 --- java/com/google/domain/registry/util/CidrAddressBlock.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/com/google/domain/registry/util/CidrAddressBlock.java b/java/com/google/domain/registry/util/CidrAddressBlock.java index f66abba0b..939e4ef65 100644 --- a/java/com/google/domain/registry/util/CidrAddressBlock.java +++ b/java/com/google/domain/registry/util/CidrAddressBlock.java @@ -268,7 +268,7 @@ public class CidrAddressBlock implements Iterable, Serializable { int bitMask = (-1 << (8 - numBits)); // Truncate the byte in which the CIDR boundary falls. - bytes[cidrByte] = (byte) ((int) bytes[cidrByte] & bitMask); + bytes[cidrByte] = (byte) (bytes[cidrByte] & bitMask); // All bytes following the cidrByte get zeroed. for (int i = cidrByte + 1; i < bytes.length; ++i) { @@ -417,7 +417,7 @@ public class CidrAddressBlock implements Iterable, Serializable { int bitMask = ~(-1 << (8 - numBits)); // Set all non-prefix bits where the CIDR boundary falls. - bytes[cidrByte] = (byte) ((int) bytes[cidrByte] | bitMask); + bytes[cidrByte] = (byte) (bytes[cidrByte] | bitMask); // All bytes following the cidrByte get set to all ones. for (int i = cidrByte + 1; i < bytes.length; ++i) {