From a443b2c269f5af6ea407d4afdc1e82733347228e Mon Sep 17 00:00:00 2001 From: Folkert Date: Mon, 10 Jun 2024 11:48:36 +0200 Subject: [PATCH] inflate window empty buf comment --- zlib-rs/src/inflate/window.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zlib-rs/src/inflate/window.rs b/zlib-rs/src/inflate/window.rs index 1834e7ee..535aa01a 100644 --- a/zlib-rs/src/inflate/window.rs +++ b/zlib-rs/src/inflate/window.rs @@ -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()