public bool SetEquals(IEnumerable <T> other) { var that = Extensions.AsDistinctCollection(Check.NotNullArgument(other, "other")); foreach (var item in that.Where(input => !Contains(input))) { GC.KeepAlive(item); return(false); } foreach (var item in this.Where(input => !that.Contains(input))) { GC.KeepAlive(item); return(false); } return(true); }
public bool SetEquals(IEnumerable <T> other) { if (other == null) { throw new ArgumentNullException("other"); } var that = Extensions.AsDistinctCollection(other); foreach (var item in that.Where(input => !Contains(input))) { GC.KeepAlive(item); return(false); } foreach (var item in this.Where(input => !that.Contains(input))) { GC.KeepAlive(item); return(false); } return(true); }