hare

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

commit 35fd6313cbffd0cd33d634c0aa29858f7b126ef2
parent df73db751c65ef4294988c1df03e66a67b666c6c
Author: Armin Weigl <tb46305@gmail.com>
Date:   Sat, 20 Feb 2021 17:03:18 +0100

bufio/fixed use slice assignment

Diffstat:
Mbufio/fixed.ha | 3+--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/bufio/fixed.ha b/bufio/fixed.ha @@ -25,8 +25,7 @@ fn fixed_read(s: *io::stream, buf: []u8) (size | io::error | io::EOF) = { return io::EOF; }; const n = if (len(buf) > len(stream.buf)) len(stream.buf) else len(buf); - // TODO: Fix me up once slice copying is in - rt::memcpy(buf: *[*]u8, stream.buf: *[*]u8, n); + buf[..n] = stream.buf[..n]; stream.buf = stream.buf[n..]; return n; };