diff options
author | Kim Alvefur <zash@zash.se> | 2020-10-12 20:20:02 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-10-12 20:20:02 +0200 |
commit | d3b3e21720094ca5d4c0c4cf659d6aee4f1b578e (patch) | |
tree | e2b8a156016a261a980bfa2ff7ba3ece37ebdbaa /util/dbuffer.lua | |
parent | 0e0a75de4e809665f97aabb781503f8be48c8f80 (diff) | |
download | prosody-d3b3e21720094ca5d4c0c4cf659d6aee4f1b578e.tar.gz prosody-d3b3e21720094ca5d4c0c4cf659d6aee4f1b578e.zip |
util.dbuffer: Expose length as :len() method, like strings
Ref #1598
Diffstat (limited to 'util/dbuffer.lua')
-rw-r--r-- | util/dbuffer.lua | 1 |
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) |