pub fn update_values(&mut self, mut f: impl FnMut(&mut V)) {
        // Commpute the key-values which actually changed. If the change is small, we preserve
        // structure sharing.
        let new_values = self
            .iter()
            .filter_map(|(k, v)| {
                let mut v_new = v.clone();
                f(&mut v_new);
                if v != &v_new {
                    Some((k.clone(), v_new))
                } else {
                    None
                }
            })
            .collect_vec();
        self.extend(new_values.into_iter());
    }
/// Updates the values in the range of the map using the given function. Notice
/// that with other kind of map representations we would use `iter_mut` for this,
/// but this is not available in OrdMap for obvious reasons (because entries are shared),
/// so we need to use this pattern here instead.
Updates the values in the range of the map using the given function. Notice
that with other kind of map representations we would use `iter_mut` for this,
but this is not available in OrdMap for obvious reasons (because entries are shared),
so we need to use this pattern here instead.
Updates the values in the range of the map using the given function . Notice that with other kind of map representations we would use ` iter_mut ` for this but this is not available in OrdMap for obvious reasons ( because entries are shared ) so we need to use this pattern here instead .
pub fn update_values(&mut self, mut f: impl FnMut(&mut V)) {
        // Commpute the key-values which actually changed. If the change is small, we preserve
        // structure sharing.
        let new_values = self
            .iter()
            .filter_map(|(k, v)| {
                let mut v_new = v.clone();
                f(&mut v_new);
                if v != &v_new {
                    Some((k.clone(), v_new))
                } else {
                    None
                }
            })
            .collect_vec();
        self.extend(new_values.into_iter());
    }
pub fn update_values ( & mut self , mut f : impl FnMut ( & mut V ) ) { // Commpute the key-values which actually changed. If the change is small, we preserve // structure sharing. let new_values = self . iter ( ) . filter_map ( | ( k , v ) | { let mut v_new = v . clone ( ) ; f ( & mut v_new ) ; if v != & v_new { Some ( ( k . clone ( ) , v_new ) ) } else { None } } ) . collect_vec ( ) ; self . extend ( new_values . into_iter ( ) ) ; }
Updates the values in the range of the map using the given function.
Updates the values in the range of the map using the given function .
&mut self
f
impl FnMut(&mut V)