pub fn remove(&mut self, key: &KeyType) -> Result<()> {
        if !self.keys.contains_key(key) {
            return Err(MinHashingError::KeyDoesNotExist);
        }
        for (hash_part, table) in self
            .keys
            .get_mut(key)
            .unwrap()
            .iter_mut()
            .zip(&mut self.hash_tables)
        {
            table.get_mut(hash_part).unwrap().remove(key);
            if let Some(set) = table.get(hash_part) {
                if set.is_empty() {
                    table.remove(hash_part);
                }
            }
        }
        self.keys.remove(key);
        Ok(())
    }
/// Remove a MinHash struct with a specific key from the MinHashLsh
Remove a MinHash struct with a specific key from the MinHashLsh
Remove a MinHash struct with a specific key from the MinHashLsh
pub fn remove(&mut self, key: &KeyType) -> Result<()> {
        if !self.keys.contains_key(key) {
            return Err(MinHashingError::KeyDoesNotExist);
        }
        for (hash_part, table) in self
            .keys
            .get_mut(key)
            .unwrap()
            .iter_mut()
            .zip(&mut self.hash_tables)
        {
            table.get_mut(hash_part).unwrap().remove(key);
            if let Some(set) = table.get(hash_part) {
                if set.is_empty() {
                    table.remove(hash_part);
                }
            }
        }
        self.keys.remove(key);
        Ok(())
    }
pub fn remove ( & mut self , key : & KeyType ) -> Result < ( ) > { if ! self . keys . contains_key ( key ) { return Err ( MinHashingError :: KeyDoesNotExist ) ; } for ( hash_part , table ) in self . keys . get_mut ( key ) . unwrap ( ) . iter_mut ( ) . zip ( & mut self . hash_tables ) { table . get_mut ( hash_part ) . unwrap ( ) . remove ( key ) ; if let Some ( set ) = table . get ( hash_part ) { if set . is_empty ( ) { table . remove ( hash_part ) ; } } } self . keys . remove ( key ) ; Ok ( ( ) ) }
Remove a MinHash struct with a specific key from the MinHashLsh
Remove a MinHash struct with a specific key from the MinHashLsh
&mut self
key
&KeyType
&mut self
key
&KeyType