Skip to content

Commit 25f3ed6

Browse files
committed
return LZ77
1 parent b02e2cc commit 25f3ed6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

AlgorithmsLibrary/LZ77Algm/LZ77Algm.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)