You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
576 B
22 lines
576 B
4 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
|
namespace Discord.Commands
|
||
|
{
|
||
|
public static class IEnumerableExtensions
|
||
|
{
|
||
|
public static IEnumerable<TResult> Permutate<TFirst, TSecond, TResult>(
|
||
|
this IEnumerable<TFirst> set,
|
||
|
IEnumerable<TSecond> others,
|
||
|
Func<TFirst, TSecond, TResult> func)
|
||
|
{
|
||
|
foreach (TFirst elem in set)
|
||
|
{
|
||
|
foreach (TSecond elem2 in others)
|
||
|
{
|
||
|
yield return func(elem, elem2);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|