Skip to content

Commit

Permalink
Special the capacity to improve performance (#3086)
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi authored Jan 12, 2021
1 parent 5fb45a4 commit b626f16
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public ICollection<string> Keys
return null;
}

var list = new List<string>();
var list = new List<string>(_nameMap.Keys.Count);
foreach (string key in _nameMap.Keys)
{
list.Add(key);
Expand All @@ -312,7 +312,7 @@ public ICollection<object> Values
return null;
}

var list = new List<object>();
var list = new List<object>(_nameMap.Values.Count);
foreach (object value in _nameMap.Values)
{
list.Add(value);
Expand Down

0 comments on commit b626f16

Please sign in to comment.