Skip to content

Commit 8b2fbbb

Browse files
committed
Added TODO comments to INFLATE.LUA about converting the sliding window from a memory buffer to file seeking on the output instead.
1 parent 27b5ea0 commit 8b2fbbb

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

arch/INFLATE.LUA

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ if not LIB then print("Please run unzip instead") os.exit(1) end
66
---@param z boolean Is this deflate64
77
function inflate(r, w, z)
88

9+
-- TODO: Pass the file handle to inflate to allow file seeking backwards sliding window instead of using RAM
10+
911
-- Z = size of sliding window
1012
-- b = buffer
1113
-- p = position
@@ -69,6 +71,8 @@ function inflate(r, w, z)
6971
op = op + 1
7072
oc = oc .. string.char(by)
7173

74+
-- TODO: Once file seeking sliding window is implemented: remove oc and o buffers and append directly to output file.
75+
7276
if #oc >= 4096 then
7377
o[#o + 1] = oc
7478
os = os + #oc
@@ -280,6 +284,8 @@ function inflate(r, w, z)
280284
-- Read from output history
281285
for _ = 1, l do
282286

287+
-- TODO: Replace this loop with file seeking sliding window logic.
288+
283289
-- c = character
284290
local c
285291

@@ -314,6 +320,7 @@ function inflate(r, w, z)
314320
end
315321

316322
-- Flush remaining data
323+
-- TODO: Once file seeking sliding window is implemented, remove flushing logic as it's redundant
317324
for i = 1, #o do w(o[i]) end
318325
if #oc > 0 then w(oc) end
319326
end

0 commit comments

Comments
 (0)