Skip to content

Commit

Permalink
Update Deflate.java
Browse files Browse the repository at this point in the history
Comment added for clarification
  • Loading branch information
mjmst74 authored Oct 28, 2024
1 parent 60a9a34 commit eb41b78
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/jcraft/jsch/jzlib/Deflate.java
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,8 @@ int longest_match(int cur_match) {
&& window[++scan] == window[++match] && window[++scan] == window[++match]
&& scan < strend);

//len here is set to MAX_MATCH minus (strend minus scan, i.e. the distance between scan and strend)
//to ensure that best_len is set to the best possible length to lookahead
len = MAX_MATCH - (strend - scan);
scan = strend - MAX_MATCH;

Expand Down

0 comments on commit eb41b78

Please sign in to comment.