mirror of
https://github.com/achanda/ipnetwork.git
synced 2025-06-18 17:57:10 +00:00
Always inline the contains function
This function is commonly called in a loop (or iterator). Inlining it makes it run faster, which is beneficial in this case.
This commit is contained in:
@ -174,6 +174,7 @@ impl Ipv6Network {
|
||||
/// assert!(net.contains(Ipv6Addr::new(0xff01, 0, 0, 0, 0, 0, 0, 0x1)));
|
||||
/// assert!(!net.contains(Ipv6Addr::new(0xffff, 0, 0, 0, 0, 0, 0, 0x1)));
|
||||
/// ```
|
||||
#[inline]
|
||||
pub fn contains(&self, ip: Ipv6Addr) -> bool {
|
||||
let a = self.addr.segments();
|
||||
let b = ip.segments();
|
||||
|
Reference in New Issue
Block a user