26 lines
793 B
C#
26 lines
793 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
|
|
namespace Google.Protobuf.Reflection
|
|
{
|
|
// Token: 0x02000057 RID: 87
|
|
internal static class DescriptorUtil
|
|
{
|
|
// Token: 0x06000570 RID: 1392 RVA: 0x00013938 File Offset: 0x00011B38
|
|
internal static IList<TOutput> ConvertAndMakeReadOnly<TInput, TOutput>(IList<TInput> input, DescriptorUtil.IndexedConverter<TInput, TOutput> converter)
|
|
{
|
|
TOutput[] array = new TOutput[input.Count];
|
|
for (int i = 0; i < array.Length; i++)
|
|
{
|
|
array[i] = converter(input[i], i);
|
|
}
|
|
return new ReadOnlyCollection<TOutput>(array);
|
|
}
|
|
|
|
// Token: 0x020000BE RID: 190
|
|
// (Invoke) Token: 0x06000766 RID: 1894
|
|
internal delegate TOutput IndexedConverter<TInput, TOutput>(TInput element, int index);
|
|
}
|
|
}
|