Skip to content

Commit ed9afa8

Browse files
Make KeysCollection.Contains methods public. (dotnet#76319)
1 parent 6098669 commit ed9afa8

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/libraries/System.Collections/ref/System.Collections.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public void CopyTo(TKey[] array, int index) { }
209209
public System.Collections.Generic.SortedDictionary<TKey, TValue>.KeyCollection.Enumerator GetEnumerator() { throw null; }
210210
void System.Collections.Generic.ICollection<TKey>.Add(TKey item) { }
211211
void System.Collections.Generic.ICollection<TKey>.Clear() { }
212-
bool System.Collections.Generic.ICollection<TKey>.Contains(TKey item) { throw null; }
212+
public bool Contains(TKey item) { throw null; }
213213
bool System.Collections.Generic.ICollection<TKey>.Remove(TKey item) { throw null; }
214214
System.Collections.Generic.IEnumerator<TKey> System.Collections.Generic.IEnumerable<TKey>.GetEnumerator() { throw null; }
215215
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
@@ -500,7 +500,7 @@ public void CopyTo(TKey[] array, int index) { }
500500
public System.Collections.Generic.Dictionary<TKey, TValue>.KeyCollection.Enumerator GetEnumerator() { throw null; }
501501
void System.Collections.Generic.ICollection<TKey>.Add(TKey item) { }
502502
void System.Collections.Generic.ICollection<TKey>.Clear() { }
503-
bool System.Collections.Generic.ICollection<TKey>.Contains(TKey item) { throw null; }
503+
public bool Contains(TKey item) { throw null; }
504504
bool System.Collections.Generic.ICollection<TKey>.Remove(TKey item) { throw null; }
505505
System.Collections.Generic.IEnumerator<TKey> System.Collections.Generic.IEnumerable<TKey>.GetEnumerator() { throw null; }
506506
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }

src/libraries/System.Collections/src/System/Collections/Generic/SortedDictionary.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ void ICollection<TKey>.Clear()
637637
throw new NotSupportedException(SR.NotSupported_KeyCollectionSet);
638638
}
639639

640-
bool ICollection<TKey>.Contains(TKey item)
640+
public bool Contains(TKey item)
641641
{
642642
return _dictionary.ContainsKey(item);
643643
}

src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ void ICollection<TKey>.Add(TKey item) =>
15041504
void ICollection<TKey>.Clear() =>
15051505
ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_KeyCollectionSet);
15061506

1507-
bool ICollection<TKey>.Contains(TKey item) =>
1507+
public bool Contains(TKey item) =>
15081508
_dictionary.ContainsKey(item);
15091509

15101510
bool ICollection<TKey>.Remove(TKey item)

src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void ICollection<TKey>.Clear()
264264
throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection);
265265
}
266266

267-
bool ICollection<TKey>.Contains(TKey item)
267+
public bool Contains(TKey item)
268268
{
269269
return _collection.Contains(item);
270270
}

src/libraries/System.Runtime/ref/System.Runtime.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7608,7 +7608,7 @@ public void CopyTo(TKey[] array, int arrayIndex) { }
76087608
public System.Collections.Generic.IEnumerator<TKey> GetEnumerator() { throw null; }
76097609
void System.Collections.Generic.ICollection<TKey>.Add(TKey item) { }
76107610
void System.Collections.Generic.ICollection<TKey>.Clear() { }
7611-
bool System.Collections.Generic.ICollection<TKey>.Contains(TKey item) { throw null; }
7611+
public bool Contains(TKey item) { throw null; }
76127612
bool System.Collections.Generic.ICollection<TKey>.Remove(TKey item) { throw null; }
76137613
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
76147614
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }

0 commit comments

Comments
 (0)