mirror of https://github.com/rust-lang/rust.git
Rollup merge of #33891 - polachok:faster-ipv4-cmp, r=bluss
Make Ipv4Addr cmp() faster Closes #33885
This commit is contained in:
commit
ee0821a371
|
@ -251,7 +251,7 @@ impl PartialOrd for Ipv4Addr {
|
|||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Ord for Ipv4Addr {
|
||||
fn cmp(&self, other: &Ipv4Addr) -> Ordering {
|
||||
self.octets().cmp(&other.octets())
|
||||
ntoh(self.inner.s_addr).cmp(&ntoh(other.inner.s_addr))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue