/// Inserts a key-count pair into the map if the key does not already exist.
/// If the key does already exist, adds count to the current value of the
/// existing key.
Inserts a key-count pair into the map if the key does not already exist.
If the key does already exist, adds count to the current value of the
existing key.
Inserts a key - count pair into the map if the key does not already exist . If the key does already exist adds count to the current value of the existing key .
pub(crate) fn insert_or_add(&mut self, key: String, count: usize) {
        use self::Occurrences::*;
        match self {
            SingleThreaded(map) => *map.entry(key).or_insert(0) += count,
            #[cfg(feature = "multithreaded")]
            MultiThreaded(arc) => arc.upsert(key, || count, |v| *v += count),
        }
    }
pub ( crate ) fn insert_or_add ( & mut self , key : String , count : usize ) { use self :: Occurrences :: * ; match self { SingleThreaded ( map ) => * map . entry ( key ) . or_insert ( 0 ) += count , # [ cfg ( feature " " ) ] MultiThreaded ( arc ) => arc . upsert ( key , | | count , | v | * v += count ) , } }
Inserts a key-count pair into the map if the key does not already exist.
Inserts a key - count pair into the map if the key does not already exist .
&mut self
key
String
count
usize