/// <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; }
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>()); }
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>(); }