You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
28 lines
823 B
C#
28 lines
823 B
C#
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System.Collections.Generic;
|
|
|
|
namespace Horde.Build.Utilities
|
|
{
|
|
/// <summary>
|
|
/// Extension methods for collections
|
|
/// </summary>
|
|
public static class CollectionExtensions
|
|
{
|
|
/// <summary>
|
|
/// Adds an arbitrary sequence of items to a protobuf map field
|
|
/// </summary>
|
|
/// <typeparam name="TKey">The key type</typeparam>
|
|
/// <typeparam name="TValue">The value type</typeparam>
|
|
/// <param name="map">The map to update</param>
|
|
/// <param name="sequence">Sequence of items to add</param>
|
|
public static void Add<TKey, TValue>(this Google.Protobuf.Collections.MapField<TKey, TValue> map, IEnumerable<KeyValuePair<TKey, TValue>> sequence)
|
|
{
|
|
foreach(KeyValuePair<TKey, TValue> pair in sequence)
|
|
{
|
|
map.Add(pair.Key, pair.Value);
|
|
}
|
|
}
|
|
}
|
|
}
|