Mercurial > prosody-hg
comparison util/dbuffer.lua @ 11158:3a72cb126d6c
Merge 0.11->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 12 Oct 2020 21:29:20 +0200 |
| parents | 6a608ecb3471 a8ef69f7fc35 |
| children | 88ce53df44a9 |
comparison
equal
deleted
inserted
replaced
| 11155:8d692a8a8f48 | 11158:3a72cb126d6c |
|---|---|
| 133 end | 133 end |
| 134 | 134 |
| 135 function dbuffer_methods:length() | 135 function dbuffer_methods:length() |
| 136 return self._length; | 136 return self._length; |
| 137 end | 137 end |
| 138 dbuffer_methods.len = dbuffer_methods.length; -- strings have :len() | |
| 138 dynamic_buffer_mt.__len = dbuffer_methods.length; -- support # operator | 139 dynamic_buffer_mt.__len = dbuffer_methods.length; -- support # operator |
| 139 | 140 |
| 140 function dbuffer_methods:collapse(bytes) | 141 function dbuffer_methods:collapse(bytes) |
| 141 bytes = bytes or self._length; | 142 bytes = bytes or self._length; |
| 142 | 143 |
