Skip to content

Commit

Permalink
inflate window empty buf comment
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev authored and rnijveld committed Jun 10, 2024
1 parent 12d95fb commit a443b2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions zlib-rs/src/inflate/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ impl<'a> Window<'a> {

pub fn size(&self) -> usize {
if self.buf.is_empty() {
// an empty `buf` is used when the window has not yet been allocated,
// or when it has been deallocated.
0
} else {
self.buf.len() - Self::padding()
Expand Down

0 comments on commit a443b2c

Please sign in to comment.