From 8f3d5ab4fb07c14784d8aa4900ac5d184f65ee24 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 12 Oct 2020 20:20:02 +0200 Subject: util.dbuffer: Expose length as :len() method, like strings Ref #1598 --- util/dbuffer.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'util') 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) -- cgit v1.2.3