# HG changeset patch # User Matthew Wild # Date 1665484487 -3600 # Node ID 79b89f3822909a0effea050b02d72a8e5d8f3116 # Parent 82915c755d90a8be5381f2ee197d1a8a5adc6022 util.dbuffer: Remove redundant code (read_chunk() cannot fail at this point) diff -r 82915c755d90 -r 79b89f382290 util/dbuffer.lua --- a/util/dbuffer.lua Sun Oct 09 15:50:25 2022 +0200 +++ b/util/dbuffer.lua Tue Oct 11 11:34:47 2022 +0100 @@ -96,13 +96,9 @@ end local chunk, read_bytes = self:read_chunk(requested_bytes); - if chunk then - requested_bytes = requested_bytes - read_bytes; - if requested_bytes == 0 then -- Already read everything we need - return true; - end - else - return nil; + requested_bytes = requested_bytes - read_bytes; + if requested_bytes == 0 then -- Already read everything we need + return true; end while chunk do