Beispiel #1
0
        public int CompareTo(WeightedValue <TValue> other)
        {
            var valueComparer = Comparer <TValue> .Default;
            var result        = valueComparer.Compare(Value, other.Value);

            return(result == 0 ? Weight.CompareTo(other.Weight) : result);
        }
Beispiel #2
0
 public static TValue FromWeightedValue(WeightedValue <TValue> weightedValue) => weightedValue.Value;
Beispiel #3
0
 public bool Equals(WeightedValue <TValue> other) => EqualityComparer <TValue> .Default.Equals(Value, other.Value) && other.Weight == Weight;