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)));
 }
示例#2
0
 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));
示例#3
0
 /// <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);
 }