aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-10-12 20:20:02 +0200
committerKim Alvefur <zash@zash.se>2020-10-12 20:20:02 +0200
commitd16ccb5cc1d32f086c257529681c02bff462e6b5 (patch)
treee2b8a156016a261a980bfa2ff7ba3ece37ebdbaa /util
parentdc45031c86d271f689a12e62364a51b6971a3820 (diff)
downloadprosody-d16ccb5cc1d32f086c257529681c02bff462e6b5.tar.gz
prosody-d16ccb5cc1d32f086c257529681c02bff462e6b5.zip
util.dbuffer: Expose length as :len() method, like strings
Ref #1598
Diffstat (limited to 'util')
-rw-r--r--util/dbuffer.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/dbuffer.lua b/util/dbuffer.lua
index a50f3a64..9d58b306 100644
--- a/util/dbuffer.lua
+++ b/util/dbuffer.lua
@@ -135,6 +135,7 @@ end
function dbuffer_methods:length()
return self._length;
end
+dbuffer_methods.len = dbuffer_methods.length; -- strings have :len()
dynamic_buffer_mt.__len = dbuffer_methods.length; -- support # operator
function dbuffer_methods:collapse(bytes)