ed

[hare] The standard editor
Log | Files | Refs | README | LICENSE

commit 23267a7d5cb63bdc51d46b3e2720ebc4ebb625aa
parent 0954da6d44e3f5bd7603620de14d3c48a40ef8a9
Author: Byron Torres <b@torresjrjr.com>
Date:   Sun, 19 Feb 2023 18:16:18 +0000

optimize buf_wipetrash()

ty, yyp

Diffstat:
Mbuffer.ha | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/buffer.ha b/buffer.ha @@ -78,9 +78,9 @@ fn buf_write(buf: *buffer, dest: io::handle, a: size, b: size) size = { }; fn buf_wipetrash(buf: *buffer) void = { - for (len(buf.trash) > 0) { - free(buf.trash[0].text); - free(buf.trash[0]); - delete(buf.trash[0]); + for (let i = 0z; i < len(buf.trash); i += 1) { + free(buf.trash[i].text); + free(buf.trash[i]); }; + delete(buf.trash[..]); };