aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-10-11 11:34:47 +0100
committerMatthew Wild <mwild1@gmail.com>2022-10-11 11:34:47 +0100
commit586a0d8493acfd511a2d2319ad68628d585f94df (patch)
treebf8d9fac41fb162618c30e07e5d1138a240c4731 /util
parentf150495cea5218ae1fe8071ed1e58fc4906bd28a (diff)
downloadprosody-586a0d8493acfd511a2d2319ad68628d585f94df.tar.gz
prosody-586a0d8493acfd511a2d2319ad68628d585f94df.zip
util.dbuffer: Remove redundant code (read_chunk() cannot fail at this point)
Diffstat (limited to 'util')
-rw-r--r--util/dbuffer.lua10
1 files changed, 3 insertions, 7 deletions
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