From b04ce1319ae2d8da1eff75988d19d08c037863d0 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Mon, 23 Sep 2024 14:49:58 -0500 Subject: [PATCH] NFC simplification of get_value_from_code eliminates `1:length(code)` construct increases concision doesn't change the generated code. --- src/Inflate.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Inflate.jl b/src/Inflate.jl index 45ea62e..fcba4fc 100644 --- a/src/Inflate.jl +++ b/src/Inflate.jl @@ -134,12 +134,12 @@ end function get_value_from_code(data::AbstractInflateData, code::Vector{Vector{Int}}) v = 0 - for i = 1:length(code) + for c in code v = (v << 1) | getbit(data) - if v < length(code[i]) - return code[i][1 + v] + if v < length(c) + return c[1 + v] end - v -= length(code[i]) + v -= length(c) end error("incomplete code table") end