Compare updated template evaluator (#4092)

This commit is contained in:
eric sciple
2025-11-07 14:18:52 -06:00
committed by GitHub
parent 53d69ff441
commit b5b7986cd6
188 changed files with 27222 additions and 4 deletions

View File

@@ -0,0 +1,23 @@
#nullable disable // Temporary: should be removed and issues fixed manually
using System;
using System.Collections.Generic;
using System.Linq;
namespace GitHub.Actions.WorkflowParser
{
internal static class EnumerableExtensions
{
/// <summary>
/// Creates a HashSet with equality comparer <paramref name="comparer"/> based on the elements
/// in <paramref name="source"/>, using transformation function <paramref name="selector"/>.
/// </summary>
public static HashSet<TOut> ToHashSet<TIn, TOut>(
this IEnumerable<TIn> source,
Func<TIn, TOut> selector,
IEqualityComparer<TOut> comparer)
{
return new HashSet<TOut>(source.Select(selector), comparer);
}
}
}