From: Huang, Zhaoquan Date: Sat, 18 Jul 2020 13:35:48 +0000 (+0800) Subject: Make Comments In SortedList Match Code Bahaviour (#39595) X-Git-Tag: submit/tizen/20210909.063632~6555 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f4d1d842575809aeddf13e73662ced6e926ef62;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Make Comments In SortedList Match Code Bahaviour (#39595) The method "EnsureCapacity" does not check whether resizing is necessary, thus the comments should not contain the conditional clause. Fix #39526 --- diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/SortedList.cs b/src/libraries/System.Collections/src/System/Collections/Generic/SortedList.cs index 57192e1..1ce3cd9 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/SortedList.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/SortedList.cs @@ -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;