Skip to content

Commit d2bb585

Browse files
authored
fix(stdlib): Buffer.toBytes should not expose the raw instance of Bytes used by the buffer (#1130)
1 parent a926ea5 commit d2bb585

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

stdlib/buffer.gr

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,7 @@ export let truncate = (length, buffer) => {
191191
* @since v0.4.0
192192
*/
193193
export let toBytes = buffer => {
194-
let len = Bytes.length(buffer.data)
195-
if (buffer.len == len) {
196-
buffer.data
197-
} else {
198-
Bytes.slice(0, buffer.len, buffer.data)
199-
}
194+
Bytes.slice(0, buffer.len, buffer.data)
200195
}
201196

202197
/**

0 commit comments

Comments
 (0)