Clarifying comment on overflow (#17865)
authorDan Moseley <danmose@microsoft.com>
Thu, 3 May 2018 00:20:50 +0000 (17:20 -0700)
committerGitHub <noreply@github.com>
Thu, 3 May 2018 00:20:50 +0000 (17:20 -0700)
* Clarifying comment on overflow

* Nits

src/mscorlib/shared/System/Buffers/Utilities.cs

index 9e8a888bee080e339152b573693d28fd03fe8c1a..b675100b03bb60917fda9ed8bea4c0ce02a643c3 100644 (file)
@@ -14,6 +14,9 @@ namespace System.Buffers
         {
             Debug.Assert(bufferSize >= 0);
 
+            // bufferSize of 0 will underflow here, causing a huge
+            // index which the caller will discard because it is not
+            // within the bounds of the bucket array.
             uint bitsRemaining = ((uint)bufferSize - 1) >> 4;
 
             int poolIndex = 0;