Skip to content

Commit

Permalink
Make Ipv4Addr cmp() faster
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Polyakov committed May 26, 2016
1 parent dc91467 commit 7ba0016
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 7ba0016

Please sign in to comment.