Rollup merge of #33891 - polachok:faster-ipv4-cmp, r=bluss

Make Ipv4Addr cmp() faster

Closes #33885
This commit is contained in:
Guillaume Gomez 2016-05-27 10:50:05 +02:00
commit ee0821a371
1 changed files with 1 additions and 1 deletions

View File

@ -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))
}
}