This is a cleaner version of the fix in https://github.com/gildas-lormeau/zip.js/pull/302 that separates pending_buf -- which is used simultaneously for 3 different buffers as an optimisation -- into 3 separate arrays. This improves maintainability and readability of the code (reducing the likelihood of introducing bugs such as this one) at the cost of 48 KiB additional memory, which I would argue is a worthwhile trade-off for a JS implementation.
This is a cleaner version of the fix in https://github.com/gildas-lormeau/zip.js/pull/302 that separates
pending_buf
-- which is used simultaneously for 3 different buffers as an optimisation -- into 3 separate arrays. This improves maintainability and readability of the code (reducing the likelihood of introducing bugs such as this one) at the cost of 48 KiB additional memory, which I would argue is a worthwhile trade-off for a JS implementation.