#region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2015 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd #endregion using System; using System.Security; using Google.Protobuf.Collections; // Note: The choice of the namespace here is important because it's rare that people will directly reference Google.Protobuf.Collections // in their app as they're typically using collections created by generated code. We are keeping the extension method in the Google.Protobuf // namespace so that it is discoverable by most users. namespace Google.Protobuf { /// /// A set of extension methods on /// public static class RepeatedFieldExtensions { // Note: This method is an extension method to avoid ambiguous overload conflict with existing AddRange(IEnumerable) when the source is an array. /// Adds the elements of the specified span to the end of the . /// The type of elements in the . /// The list to which the elements should be added. /// The span whose elements should be added to the end of the . /// The is null. [SecuritySafeCritical] public static void AddRange(this RepeatedField repeatedField, ReadOnlySpan source) { ProtoPreconditions.CheckNotNull(repeatedField, nameof(repeatedField)); repeatedField.AddRangeSpan(source); } } }