@@ -906,12 +906,12 @@ public StringBuilder Replace(
906906 int index = indexInChunk + chunk . _chunkOffset ;
907907
908908 ReplaceAllInChunk ( sourceArray , replacementsCount , chunk , oldLength , newValue ) ;
909-
909+
910910 index += ( newLength - oldLength ) * replacementsCount ;
911911 replacementsCount = 0 ;
912-
912+
913913 chunk = FindChunkForIndex ( index ) ;
914-
914+
915915 indexInChunk = index - chunk . _chunkOffset ;
916916 }
917917 }
@@ -1138,13 +1138,13 @@ internal void ReplaceAllInChunk(
11381138 {
11391139 // Determine the amount of characters to remove
11401140 int count = ( value . Length - removeCount ) * replacementsCount ;
1141-
1141+
11421142 // Scope the working chunk
11431143 StringBuilder chunk = sourceChunk ;
1144-
1144+
11451145 // Determine the index of the first replacement
11461146 int indexInChunk = replacements [ 0 ] ;
1147-
1147+
11481148 // If there is a character being added make room
11491149 if ( count > 0 )
11501150 {
@@ -1169,18 +1169,18 @@ internal void ReplaceAllInChunk(
11691169 chars ,
11701170 ref replacementIndex ,
11711171 value . Length ) ;
1172-
1172+
11731173 if ( replacementIndex == value . Length )
11741174 {
11751175 replacementIndex = 0 ;
11761176 }
11771177
11781178 // Determine the next replacement
11791179 int valueIndex = replacements [ index ] + removeCount ;
1180-
1180+
11811181 // Move the pointer of the working replacement
11821182 ++ index ;
1183-
1183+
11841184 // If we are not past the replacement boundary
11851185 if ( index < replacementsCount )
11861186 {
@@ -1242,7 +1242,7 @@ private void ReplaceInPlaceAtChunk(
12421242 while ( true )
12431243 {
12441244 int length = MathInternal . Min ( chunk . _chunkLength - indexInChunk , count ) ;
1245-
1245+
12461246 Array . Copy (
12471247 value ,
12481248 valueIndex ,
@@ -1283,7 +1283,7 @@ internal void MakeRoom(
12831283#pragma warning restore S3928 // OK to use in .NET nanoFramework context
12841284
12851285 chunk = this ;
1286-
1286+
12871287 while ( chunk . _chunkOffset > index )
12881288 {
12891289 chunk . _chunkOffset += count ;
@@ -1314,9 +1314,9 @@ internal void MakeRoom(
13141314 chunk . _chunkPrevious ) ;
13151315
13161316 builder . _chunkLength = count ;
1317-
1317+
13181318 int length = MathInternal . Min ( count , indexInChunk ) ;
1319-
1319+
13201320 if ( length > 0 )
13211321 {
13221322 Array . Copy (
@@ -1325,9 +1325,9 @@ internal void MakeRoom(
13251325 builder . _chunkChars ,
13261326 0 ,
13271327 length ) ;
1328-
1328+
13291329 int nextLength = indexInChunk - length ;
1330-
1330+
13311331 if ( nextLength >= 0 )
13321332 {
13331333 Array . Copy (
@@ -1336,7 +1336,7 @@ internal void MakeRoom(
13361336 chunk . _chunkChars ,
13371337 0 ,
13381338 nextLength ) ;
1339-
1339+
13401340 indexInChunk = nextLength ;
13411341 }
13421342 }
@@ -1355,7 +1355,7 @@ internal void MakeRoom(
13551355 internal StringBuilder FindChunkForIndex ( int index )
13561356 {
13571357 StringBuilder chunkPrevious = this ;
1358-
1358+
13591359 while ( chunkPrevious . _chunkOffset > index )
13601360 {
13611361 chunkPrevious = chunkPrevious . _chunkPrevious ;
@@ -1411,10 +1411,10 @@ internal void Remove(int startIndex, int count, out StringBuilder chunk, out int
14111411 {
14121412 int num = startIndex + count ;
14131413 chunk = this ;
1414-
1414+
14151415 StringBuilder builder = null ;
14161416 int sourceIndex = 0 ;
1417-
1417+
14181418 while ( true )
14191419 {
14201420 if ( num - chunk . _chunkOffset >= 0 )
@@ -1430,14 +1430,14 @@ internal void Remove(int startIndex, int count, out StringBuilder chunk, out int
14301430 indexInChunk = startIndex - chunk . _chunkOffset ;
14311431 int destinationIndex = indexInChunk ;
14321432 int num4 = builder . _chunkLength - sourceIndex ;
1433-
1433+
14341434 if ( builder != chunk )
14351435 {
14361436 destinationIndex = 0 ;
14371437 chunk . _chunkLength = indexInChunk ;
14381438 builder . _chunkPrevious = chunk ;
14391439 builder . _chunkOffset = chunk . _chunkOffset + chunk . _chunkLength ;
1440-
1440+
14411441 if ( indexInChunk == 0 )
14421442 {
14431443 builder . _chunkPrevious = chunk . _chunkPrevious ;
@@ -1507,9 +1507,9 @@ internal void Append(
15071507 }
15081508
15091509 int minBlockCharCount = valueCount - count ;
1510-
1510+
15111511 ExpandByABlock ( minBlockCharCount ) ;
1512-
1512+
15131513 Array . Copy (
15141514 value ,
15151515 count ,
0 commit comments