hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit ba10bceec960043c8f4a29ee9ebcf4bae4c6e73d
parent b2d01b32f15688f225c4b8a01fb879c33ce4419e
Author: Autumn! <autumnull@posteo.net>
Date:   Thu,  7 Sep 2023 14:47:25 +0000

bytes: use rt::memset in zero()

Signed-off-by: Autumn! <autumnull@posteo.net>

Diffstat:
Mbytes/zero.ha | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/bytes/zero.ha b/bytes/zero.ha @@ -1,10 +1,9 @@ // License: MPL-2.0 // (c) 2021 Drew DeVault <sir@cmpwn.com> +use rt; // Sets all bytes in a slice to zero. This is suitable for erasing private data // from a slice. export fn zero(buf: []u8) void = { - for (let i = 0z; i < len(buf); i += 1) { - buf[i] = 0; - }; + rt::memset(buf: *[*]u8, 0, len(buf)); };