cairo_lang_utils::collection_arithmetics

Function add_maps

source
pub fn add_maps<Key: Hash + Eq, Value: HasZero + Add<Output = Value> + Clone + Eq, Rhs: IntoIterator<Item = (Key, Value)>, BH: BuildHasher>(
    lhs: OrderedHashMap<Key, Value, BH>,
    rhs: Rhs,
) -> OrderedHashMap<Key, Value, BH>
Expand description

Returns a map which contains the sum of the values from the given two maps, for each key.

If the key is missing from one of them, it is treated as zero.