janvanbesien / java-ipv6

Java library to represent IPv6 addresses, networks, and related concepts
Apache License 2.0
85 stars 33 forks source link

redundant code #25

Open xwdeng opened 7 years ago

xwdeng commented 7 years ago

does the second else if(this.highbits==that.hightbits) redundant?

public int compareTo(IPv6Address that) { if (this.highBits == that.highBits) if (this.lowBits == that.lowBits) return 0; else return IPv6AddressHelpers.isLessThanUnsigned(this.lowBits, that.lowBits) ? -1 : 1; else if (this.highBits == that.highBits) return 0; else return IPv6AddressHelpers.isLessThanUnsigned(this.highBits, that.highBits) ? -1 : 1; }

janvanbesien commented 7 years ago

Yes indeed. I'll fix it.

mambistats commented 7 years ago

Hard to fix? It is still there ... I just removed the two lines in my code ... ;)