fn remove_from()

in src/storage/seg/src/hashtable/mod.rs [589:617]


    fn remove_from(&mut self, key: &[u8], offset: i32, segment: &mut Segment) -> bool {
        let hash = self.hash(key);
        let tag = tag_from_hash(hash);
        let evict_item_info = build_item_info(tag, segment.id(), offset as u64);

        let iter = IterMut::new(self, hash);

        for item_info in iter {
            let current_item_info = clear_freq(*item_info);
            if get_tag(current_item_info) != tag {
                continue;
            }

            if get_seg_id(current_item_info) != Some(segment.id())
                || get_offset(current_item_info) != offset as u64
            {
                HASH_TAG_COLLISION.increment();
                continue;
            }

            if evict_item_info == current_item_info {
                segment.remove_item(current_item_info);
                *item_info = 0;
                return true;
            }
        }

        false
    }