Make Comments In SortedList Match Code Bahaviour (#39595)
authorHuang, Zhaoquan <zhaoquan2008@hotmail.com>
Sat, 18 Jul 2020 13:35:48 +0000 (21:35 +0800)
committerGitHub <noreply@github.com>
Sat, 18 Jul 2020 13:35:48 +0000 (06:35 -0700)
The method "EnsureCapacity" does not check whether resizing
is necessary, thus the comments should not contain the conditional
clause.

Fix #39526

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

index 57192e1..1ce3cd9 100644 (file)
@@ -526,9 +526,8 @@ namespace System.Collections.Generic
         private const int MaxArrayLength = 0X7FEFFFFF;
 
         // Ensures that the capacity of this sorted list is at least the given
-        // minimum value. If the current capacity of the list is less than
-        // min, the capacity is increased to twice the current capacity or
-        // to min, whichever is larger.
+        // minimum value. The capacity is increased to twice the current capacity
+        // or to min, whichever is larger.
         private void EnsureCapacity(int min)
         {
             int newCapacity = keys.Length == 0 ? DefaultCapacity : keys.Length * 2;