Convergence() публичный Метод

public Convergence ( UniqueAddress selfUniqueAddress ) : bool
selfUniqueAddress UniqueAddress
Результат bool
Пример #1
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="oldGossip">TBD</param>
        /// <param name="newGossip">TBD</param>
        /// <param name="selfUniqueAddress">TBD</param>
        /// <returns>TBD</returns>
        internal static ImmutableList<SeenChanged> DiffSeen(Gossip oldGossip, Gossip newGossip, UniqueAddress selfUniqueAddress)
        {
            if (newGossip.Equals(oldGossip))
            {
                return ImmutableList<SeenChanged>.Empty;
            }

            var newConvergence = newGossip.Convergence(selfUniqueAddress, EmptySet);
            var newSeenBy = newGossip.SeenBy;
            if (!newConvergence.Equals(oldGossip.Convergence(selfUniqueAddress, EmptySet)) || !newSeenBy.SequenceEqual(oldGossip.SeenBy))
            {
                return ImmutableList.Create(new SeenChanged(newConvergence, newSeenBy.Select(s => s.Address).ToImmutableHashSet()));
            }

            return ImmutableList<SeenChanged>.Empty;
        }
Пример #2
0
        internal static ImmutableList <SeenChanged> DiffSeen(Gossip oldGossip, Gossip newGossip, UniqueAddress selfUniqueAddres)
        {
            if (newGossip.Equals(oldGossip))
            {
                return(ImmutableList.Create <SeenChanged>());
            }

            var newConvergence = newGossip.Convergence(selfUniqueAddres);
            var newSeenBy      = newGossip.SeenBy;

            if (newConvergence != oldGossip.Convergence(selfUniqueAddres) || newSeenBy != oldGossip.SeenBy)
            {
                return(ImmutableList.Create(new SeenChanged(newConvergence,
                                                            newSeenBy.Select(s => s.Address).ToImmutableHashSet())));
            }
            return(ImmutableList.Create <SeenChanged>());
        }
Пример #3
0
        internal static ImmutableList<SeenChanged> DiffSeen(Gossip oldGossip, Gossip newGossip, UniqueAddress selfUniqueAddres)
        {
            if (newGossip.Equals(oldGossip)) 
                return ImmutableList.Create<SeenChanged>();

            var newConvergence = newGossip.Convergence(selfUniqueAddres);
            var newSeenBy = newGossip.SeenBy;
            if (newConvergence != oldGossip.Convergence(selfUniqueAddres) || newSeenBy != oldGossip.SeenBy)
                return ImmutableList.Create(new SeenChanged(newConvergence,
                        newSeenBy.Select(s => s.Address).ToImmutableHashSet()));
            return ImmutableList.Create<SeenChanged>();
        }