mirror of
https://github.com/google/nomulus
synced 2025-12-23 14:25:44 +00:00
Drop unnecessary typecast in CidrAddressBlock
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=117002905
This commit is contained in:
@@ -268,7 +268,7 @@ public class CidrAddressBlock implements Iterable<InetAddress>, 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<InetAddress>, 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) {
|
||||
|
||||
Reference in New Issue
Block a user