File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ public static string decompress(string compressed)
232
232
int enlargeIn = 4 ;
233
233
int numBits = 3 ;
234
234
string entry = "" ;
235
- string result = "" ;
235
+ StringBuilder result = new StringBuilder ( ) ;
236
236
int i = 0 ;
237
237
dynamic w = "" ;
238
238
dynamic c = "" ;
@@ -265,7 +265,8 @@ public static string decompress(string compressed)
265
265
}
266
266
267
267
dictionary . Add ( c ) ;
268
- w = result = c ;
268
+ result . Append ( c ) ;
269
+ w = result . ToString ( ) ;
269
270
270
271
while ( true )
271
272
{
@@ -292,7 +293,7 @@ public static string decompress(string compressed)
292
293
293
294
break ;
294
295
case 2 :
295
- return result ;
296
+ return result . ToString ( ) ;
296
297
}
297
298
298
299
if ( enlargeIn == 0 )
@@ -318,7 +319,7 @@ public static string decompress(string compressed)
318
319
}
319
320
}
320
321
321
- result += entry ;
322
+ result . Append ( entry ) ;
322
323
dictionary . Add ( w + entry [ 0 ] ) ;
323
324
enlargeIn -- ;
324
325
w = entry ;
You can’t perform that action at this time.
0 commit comments