From 586a0d8493acfd511a2d2319ad68628d585f94df Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 11 Oct 2022 11:34:47 +0100 Subject: util.dbuffer: Remove redundant code (read_chunk() cannot fail at this point) --- util/dbuffer.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'util') diff --git a/util/dbuffer.lua b/util/dbuffer.lua index 3ad5fdfe..6c671fa3 100644 --- a/util/dbuffer.lua +++ b/util/dbuffer.lua @@ -96,13 +96,9 @@ function dbuffer_methods:discard(requested_bytes) 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 -- cgit v1.2.3