diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs b/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs index 2f7406d0d7bf4..10c815c503551 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs @@ -1366,7 +1366,7 @@ public bool Overlaps(IEnumerable other) /// An earlier implementation used delegates to perform these checks rather than returning /// an ElementCount struct; however this was changed due to the perf overhead of delegates. /// - private unsafe ElementCount CheckUniqueAndUnfoundElements(IEnumerable other, bool returnIfUnfound) + private ElementCount CheckUniqueAndUnfoundElements(IEnumerable other, bool returnIfUnfound) { ElementCount result; diff --git a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs index f39fe93b13454..6bc713d127f3c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs @@ -1570,7 +1570,7 @@ private void IntersectWithHashSetWithSameComparer(HashSet other) /// /// This attempts to allocate on the stack, if below StackAllocThreshold. /// - private unsafe void IntersectWithEnumerable(IEnumerable other) + private void IntersectWithEnumerable(IEnumerable other) { Debug.Assert(_buckets != null, "_buckets shouldn't be null; callers should check first"); @@ -1642,7 +1642,7 @@ private void SymmetricExceptWithUniqueHashSet(HashSet other) /// /// /// - private unsafe void SymmetricExceptWithEnumerable(IEnumerable other) + private void SymmetricExceptWithEnumerable(IEnumerable other) { int originalCount = _count; int intArrayLength = BitHelper.ToIntArrayLength(originalCount);