Skip to content

Commit 64d9729

Browse files
brianpanefolkertdev
authored andcommitted
Update comments to clarify how matches count is used
1 parent 09b4eb9 commit 64d9729

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

zlib-rs/src/deflate.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,8 +1284,9 @@ pub(crate) struct State<'a> {
12841284
pub(crate) max_lazy_match: u16,
12851285

12861286
/// number of string matches in current block
1287-
/// Note: this counter is just 8 bits to help keep the struct compact. Code that
1288-
/// increments it must be careful to avoid overflow.
1287+
/// NOTE: this is a saturating 8-bit counter, to help keep the struct compact. The code that
1288+
/// makes decisions based on this field only cares whether the count is greater than 2, so
1289+
/// an 8-bit counter is sufficient.
12891290
pub(crate) matches: u8,
12901291

12911292
/// Window position at the beginning of the current output block. Gets

0 commit comments

Comments
 (0)