File tree Expand file tree Collapse file tree
AlgorithmsLibrary/LZ77Algm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ public static IAlgmEncoded<List<CodeBlock>> Encode(string inputString)
7171 establishingBuffer . Append ( '$' ) ;
7272 char nextChar = establishingBuffer [ currentLengthSubString ] ;
7373
74- string subInEstablish = establishingBuffer . Substring ( 0 , currentLengthSubString + 1 ) ;
75- establishingBuffer . Remove ( 0 , length + 1 ) ;
74+ string subInEstablish = establishingBuffer . Substring ( 0 , currentLengthSubString ) ;
75+ establishingBuffer . Remove ( 0 , length ) ;
7676 searchBuffer . Append ( subInEstablish ) ;
7777
7878 var codeblock = new CodeBlock ( offset , length , nextChar ) ;
@@ -154,6 +154,7 @@ public static IAlgmEncoded<string> Decode(string encodedString)
154154 int start = resultDecoding . Length - codeBlock . Offset ;
155155 for ( int i = 0 ; i <= codeBlock . Length - 1 ; i ++ )
156156 resultDecoding . Append ( resultDecoding [ start + i ] ) ;
157+ continue ;
157158 }
158159 resultDecoding . Append ( codeBlock . NextChar ) ;
159160 }
You can’t perform that action at this time.
0 commit comments