pub fn remove(&mut self, e: u32) -> bool {
        match self.internal_mut() {
            InternalMut::Empty => false,
            InternalMut::Tiny(mut t) => {
                let b = t.remove(e);
                *self = SetU32(I { tiny: t.to_usize() });
                b
            }
            InternalMut::Dense { a, sz } => {
                let key = e as usize >> 5;
                let bit = 1 << (e & 31);
                if a.len() > key {
                    if a[key] & bit != 0 {
                        a[key] = a[key] & !bit;
                        *sz -= 1;
                        true
                    } else {
                        false
                    }
                } else {
                    false
                }
            }
            InternalMut::Table { a, sz, cap_ptr, .. } => {
                let (key, bits) = to_key_and_bit(e);
                if let LookedUp::KeyFound(idx) = p_lookfor(key, a) {
                    if a[idx].1 & bits != 0 {
                        let new = a[idx].1 & !bits;
                        *sz -= 1;
                        if new == 0 {
                            // We've removed everything with this key,
                            // so remove the whole key!
                            p_remove(key, a);
                            *cap_ptr += 32;
                        } else {
                            a[idx].1 = new;
                        }
                        true
                    } else {
                        false
                    }
                } else {
                    false
                }
            }
        }
    }
/// Remove a number from the set.
///
/// Return a bool indicating if it was present.
Remove a number from the set.
Return a bool indicating if it was present.
Remove a number from the set . Return a bool indicating if it was present .
pub fn remove(&mut self, e: u32) -> bool {
        match self.internal_mut() {
            InternalMut::Empty => false,
            InternalMut::Tiny(mut t) => {
                let b = t.remove(e);
                *self = SetU32(I { tiny: t.to_usize() });
                b
            }
            InternalMut::Dense { a, sz } => {
                let key = e as usize >> 5;
                let bit = 1 << (e & 31);
                if a.len() > key {
                    if a[key] & bit != 0 {
                        a[key] = a[key] & !bit;
                        *sz -= 1;
                        true
                    } else {
                        false
                    }
                } else {
                    false
                }
            }
            InternalMut::Table { a, sz, cap_ptr, .. } => {
                let (key, bits) = to_key_and_bit(e);
                if let LookedUp::KeyFound(idx) = p_lookfor(key, a) {
                    if a[idx].1 & bits != 0 {
                        let new = a[idx].1 & !bits;
                        *sz -= 1;
                        if new == 0 {
                            // We've removed everything with this key,
                            // so remove the whole key!
                            p_remove(key, a);
                            *cap_ptr += 32;
                        } else {
                            a[idx].1 = new;
                        }
                        true
                    } else {
                        false
                    }
                } else {
                    false
                }
            }
        }
    }
pub fn remove ( & mut self , e : u32 ) -> bool { match self . internal_mut ( ) { InternalMut :: Empty => false , InternalMut :: Tiny ( mut t ) => { let b = t . remove ( e ) ; * self = SetU32 ( I { tiny : t . to_usize ( ) } ) ; b } InternalMut :: Dense { a , sz } => { let key = e as usize >> 5 ; let bit = 1 << ( e & 31 ) ; if a . len ( ) > key { if a [ key ] & bit != 0 { a [ key ] = a [ key ] & ! bit ; * sz -= 1 ; true } else { false } } else { false } } InternalMut :: Table { a , sz , cap_ptr , .. } => { let ( key , bits ) = to_key_and_bit ( e ) ; if let LookedUp :: KeyFound ( idx ) = p_lookfor ( key , a ) { if a [ idx ] . 1 & bits != 0 { let new = a [ idx ] . 1 & ! bits ; * sz -= 1 ; if new == 0 { // We've removed everything with this key, // so remove the whole key! p_remove ( key , a ) ; * cap_ptr += 32 ; } else { a [ idx ] . 1 = new ; } true } else { false } } else { false } } } }
Remove a number from the set.
Remove a number from the set .
&mut self
e
u32
&mut self
e
u32