From 5995d723bc0d3d58f327e0d7ab38068b620d0e50 Mon Sep 17 00:00:00 2001 From: Sydney Acksman Date: Sun, 21 Jul 2019 05:17:42 -0500 Subject: [PATCH] Rename ExtensionRegistry.Add(IEnumerable) overload to AddRange --- csharp/src/Google.Protobuf/ExtensionRegistry.cs | 6 +++--- csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/csharp/src/Google.Protobuf/ExtensionRegistry.cs b/csharp/src/Google.Protobuf/ExtensionRegistry.cs index 8056304c788d..06701d515251 100644 --- a/csharp/src/Google.Protobuf/ExtensionRegistry.cs +++ b/csharp/src/Google.Protobuf/ExtensionRegistry.cs @@ -85,11 +85,11 @@ public void Add(Extension extension) /// /// Adds the specified extensions to the reigstry /// - public void Add(IEnumerable newExtensions) + public void AddRange(IEnumerable extensions) { - ProtoPreconditions.CheckNotNull(newExtensions, nameof(newExtensions)); + ProtoPreconditions.CheckNotNull(extensions, nameof(extensions)); - foreach (var extension in newExtensions) + foreach (var extension in extensions) Add(extension); } diff --git a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs index 4c2fe54d560b..9b20e3d22ad6 100644 --- a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs @@ -407,7 +407,7 @@ public static FileDescriptor FromGeneratedCode( private static void AddAllExtensions(FileDescriptor[] dependencies, GeneratedClrTypeInfo generatedInfo, ExtensionRegistry registry) { - registry.Add(dependencies.SelectMany(GetAllDependedExtensions).Concat(GetAllGeneratedExtensions(generatedInfo)).ToArray()); + registry.AddRange(dependencies.SelectMany(GetAllDependedExtensions).Concat(GetAllGeneratedExtensions(generatedInfo)).ToArray()); } private static IEnumerable GetAllGeneratedExtensions(GeneratedClrTypeInfo generated)