File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
AlgorithmsLibrary/LZ77Algm Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,8 @@ public static IAlgmEncoded<List<CodeBlock>> Encode(string inputString)
7272 establishingBuffer . Append ( '$' ) ;
7373 char nextChar = establishingBuffer [ currentLengthSubString ] ;
7474
75- string subInEstablish = establishingBuffer . Substring ( 0 , currentLengthSubString ) ;
76- establishingBuffer . Remove ( 0 , length ) ;
75+ string subInEstablish = establishingBuffer . Substring ( 0 , currentLengthSubString + 1 ) ;
76+ establishingBuffer . Remove ( 0 , length + 1 ) ;
7777 searchBuffer . Append ( subInEstablish ) ;
7878
7979 var codeblock = new CodeBlock ( offset , length , nextChar ) ;
@@ -155,7 +155,6 @@ public static IAlgmEncoded<string> Decode(string encodedString)
155155 int start = resultDecoding . Length - codeBlock . Offset ;
156156 for ( int i = 0 ; i <= codeBlock . Length - 1 ; i ++ )
157157 resultDecoding . Append ( resultDecoding [ start + i ] ) ;
158- continue ;
159158 }
160159 resultDecoding . Append ( codeBlock . NextChar ) ;
161160 }
You can’t perform that action at this time.
0 commit comments