util.dbuffer: Remove redundant code (read_chunk() cannot fail at this point)
authorMatthew Wild <mwild1@gmail.com>
Tue, 11 Oct 2022 11:34:47 +0100
changeset 12766 79b89f382290
parent 12765 82915c755d90
child 12767 d26eefe98d09
util.dbuffer: Remove redundant code (read_chunk() cannot fail at this point)
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