Skip to content

Commit

Permalink
add comment back
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Feb 14, 2024
1 parent ecb91b8 commit ee1cf20
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions zlib-rs/src/read_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ impl<'a> ReadBuf<'a> {
let start = current.checked_sub(offset_from_end).expect("in bounds");
let end = start.checked_add(length).expect("in bounds");

// Note also that the referenced string may overlap the current
// position; for example, if the last 2 bytes decoded have values
// X and Y, a string reference with <length = 5, distance = 2>
// adds X,Y,X,Y,X to the output stream.

if end > current {
if offset_from_end == 1 {
// this will just repeat this value many times
Expand Down

0 comments on commit ee1cf20

Please sign in to comment.