mirror of
https://github.com/actions/runner.git
synced 2026-01-17 17:27:41 +08:00
Compare updated template evaluator (#4092)
This commit is contained in:
22
src/Sdk/WorkflowParser/CollectionsExtensions.cs
Normal file
22
src/Sdk/WorkflowParser/CollectionsExtensions.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GitHub.Actions.WorkflowParser
|
||||
{
|
||||
internal static class CollectionsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds all of the given values to this collection.
|
||||
/// Can be used with dictionaries, which implement <see cref="ICollection{T}"/> and <see cref="IEnumerable{T}"/> where T is <see cref="KeyValuePair{TKey, TValue}"/>.
|
||||
/// </summary>
|
||||
public static TCollection AddRange<T, TCollection>(this TCollection collection, IEnumerable<T> values)
|
||||
where TCollection : ICollection<T>
|
||||
{
|
||||
foreach (var value in values)
|
||||
{
|
||||
collection.Add(value);
|
||||
}
|
||||
|
||||
return collection;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user