File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
src/LinkDotNet.StringBuilder Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ All notable changes to **ValueStringBuilder** will be documented in this file. T
99### Added
1010- Added the ` scoped ` keyword to simplify code and allow more scenarios for the user
1111
12+ ### Fixed
13+ - ` Grow ` allowed values, which would truncate the internally represented string
14+
1215## [ 1.3.0] - 2022-07-25
1316
1417### Fixed
Original file line number Diff line number Diff line change @@ -259,9 +259,7 @@ private void Grow(int capacity = 0)
259259 {
260260 var currentSize = buffer . Length ;
261261
262- // This could lead to the potential problem that an user sets the capacity smaller than the current length
263- // which would lead to a truncated string.
264- var newSize = capacity > 0 ? capacity : currentSize * 2 ;
262+ var newSize = capacity > currentSize ? capacity : currentSize * 2 ;
265263 var rented = ArrayPool < char > . Shared . Rent ( newSize ) ;
266264 buffer . CopyTo ( rented ) ;
267265 var toReturn = arrayFromPool ;
You can’t perform that action at this time.
0 commit comments