mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 12:07:51 +02:00
Drop unnecessary typecast in CidrAddressBlock
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=117002905
This commit is contained in:
parent
5d97f04ebe
commit
d006506531
1 changed files with 2 additions and 2 deletions
|
@ -268,7 +268,7 @@ public class CidrAddressBlock implements Iterable<InetAddress>, Serializable {
|
||||||
int bitMask = (-1 << (8 - numBits));
|
int bitMask = (-1 << (8 - numBits));
|
||||||
|
|
||||||
// Truncate the byte in which the CIDR boundary falls.
|
// 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.
|
// All bytes following the cidrByte get zeroed.
|
||||||
for (int i = cidrByte + 1; i < bytes.length; ++i) {
|
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));
|
int bitMask = ~(-1 << (8 - numBits));
|
||||||
|
|
||||||
// Set all non-prefix bits where the CIDR boundary falls.
|
// 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.
|
// All bytes following the cidrByte get set to all ones.
|
||||||
for (int i = cidrByte + 1; i < bytes.length; ++i) {
|
for (int i = cidrByte + 1; i < bytes.length; ++i) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue