/// <inheritdoc/> public override ImmutableSortedSet <T> ConvertFromSurrogate(ref ImmutableSortedSetSurrogate <T> surrogate) { if (surrogate.Values is null) { return(null); } else { if (surrogate.KeyComparer is object) { return(ImmutableSortedSet.CreateRange(surrogate.KeyComparer, surrogate.Values)); } else { return(ImmutableSortedSet.CreateRange(surrogate.Values)); } } }
/// <inheritdoc/> public override void ConvertToSurrogate(ImmutableSortedSet <T> value, ref ImmutableSortedSetSurrogate <T> surrogate) { if (value is null) { surrogate = default; return; } else { surrogate = new ImmutableSortedSetSurrogate <T> { Values = new List <T>(value) }; if (!ReferenceEquals(value.KeyComparer, Comparer <T> .Default)) { surrogate.KeyComparer = value.KeyComparer; } } }