blob: 196a4becb9c1794ff889bb7f429fde39d45fb348 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Collections.Generic;
namespace System.Web.Razor.Test.Utils
{
public static class EnumerableUtils
{
public static void RunPairwise<T, V>(IEnumerable<T> left, IEnumerable<V> right, Action<T, V> action)
{
IEnumerator<T> leftEnum = left.GetEnumerator();
IEnumerator<V> rightEnum = right.GetEnumerator();
while (leftEnum.MoveNext() && rightEnum.MoveNext())
{
action(leftEnum.Current, rightEnum.Current);
}
}
}
}
|