// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Runtime.CompilerServices; using CommunityToolkit.HighPerformance.Helpers; namespace CommunityToolkit.HighPerformance; /// /// Helpers for working with the type. /// public static class HashCodeExtensions { /// /// Adds a sequence of values to the hash code. /// /// The type of elements in the input instance. /// The input instance. /// The input instance. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Add(ref this HashCode hashCode, ReadOnlySpan span) where T : notnull { int hash = HashCode.CombineValues(span); hashCode.Add(hash); } }