using System; using System.Collections; using System.Collections.Generic; namespace UnityEditor.Graphing.Util { public static class EnumerableExtensions { public static IEnumerable Zip(this IEnumerable first, IEnumerable second, Func resultSelector) { var e1 = first.GetEnumerator(); var e2 = second.GetEnumerator(); while (e1.MoveNext() && e2.MoveNext()) { yield return resultSelector(e1.Current, e2.Current); } } public static IEnumerable> Zip(this IEnumerable first, IEnumerable second) { return first.Zip(second, ValueTuple.Create); } } }