public static IImmutableDictionary <TDestKey, TValue> ChangeKeys <TSourceKey, TDestKey, TValue>( this IImmutableDictionary <TSourceKey, TValue> d, Func <TSourceKey, TDestKey> selector) { return(d.Aggregate(ImmutableDictionary <TDestKey, TValue> .Empty, (current, keyValuePair) => current.SetItem(selector(keyValuePair.Key), keyValuePair.Value))); }
private IReplicatedData Cleaned(IReplicatedData c, IImmutableDictionary <UniqueAddress, IPruningState> p) => p.Aggregate(c, (state, kvp) => { if (c is IRemovedNodePruning pruning && kvp.Value is PruningPerformed && pruning.NeedPruningFrom(kvp.Key)) { return(pruning.PruningCleanup(kvp.Key));
/// <summary> /// TBD /// </summary> /// <param name="state">TBD</param> public GCounter(IImmutableDictionary <UniqueAddress, BigInteger> state) { State = state; Value = State.Aggregate(Zero, (v, acc) => v + acc.Value); }