Skip to content

Commit

Permalink
fix(stdlib): Buffer.toBytes should not expose the raw instance of Byt…
Browse files Browse the repository at this point in the history
…es used by the buffer (#1130)
  • Loading branch information
cician committed Mar 6, 2022
1 parent a926ea5 commit d2bb585
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions stdlib/buffer.gr
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,7 @@ export let truncate = (length, buffer) => {
* @since v0.4.0
*/
export let toBytes = buffer => {
let len = Bytes.length(buffer.data)
if (buffer.len == len) {
buffer.data
} else {
Bytes.slice(0, buffer.len, buffer.data)
}
Bytes.slice(0, buffer.len, buffer.data)
}

/**
Expand Down

0 comments on commit d2bb585

Please sign in to comment.