Skip to content

Commit

Permalink
Rollup merge of rust-lang#33891 - polachok:faster-ipv4-cmp, r=bluss
Browse files Browse the repository at this point in the history
Make Ipv4Addr cmp() faster

Closes rust-lang#33885
  • Loading branch information
GuillaumeGomez committed May 27, 2016
2 parents 6636dcc + 7ba0016 commit ee0821a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/net/ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}

Expand Down

0 comments on commit ee0821a

Please sign in to comment.