Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
CoreFx #15622 Dictionary<TKey, TValue>.Remove(TKey, out TValue)
Browse files Browse the repository at this point in the history
  • Loading branch information
WinCPP committed Apr 11, 2017
1 parent 3617c6b commit 3e836ad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mscorlib/src/System/Collections/Generic/Dictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,9 @@ private void Resize(int newSize, bool forceNewHashCodes)
entries = newEntries;
}

// The overload Remove(TKey key, out TValue value) is a copy of this method with one additional
// statement to copy the value for entry being removed into the output parameter.
// Code has been intentionally duplicated for performance reasons.
public bool Remove(TKey key)
{
if (key == null)
Expand Down Expand Up @@ -628,6 +631,9 @@ public bool Remove(TKey key)
return false;
}

// This overload is a copy of the overload Remove(TKey key) with one additional
// statement to copy the value for entry being removed into the output parameter.
// Code has been intentionally duplicated for performance reasons.
public bool Remove(TKey key, out TValue value)
{
if (key == null)
Expand Down

0 comments on commit 3e836ad

Please sign in to comment.