Fix slice return

This commit is contained in:
Jordi Baylina
2020-10-20 17:30:43 +02:00
parent f5a56f4a13
commit f2c735dcee
2 changed files with 2 additions and 2 deletions

View File

@@ -5112,7 +5112,7 @@ class BigBuffer {
// bytes to copy from this page
const l = (o+r > PAGE_SIZE) ? (PAGE_SIZE -o) : r;
const srcView = new Uint8Array(this.buffers[p].buffer, this.buffers[p].byteOffset+o, l);
if (l == len) return srcView;
if (l == len) return srcView.slice();
if (!buff) {
if (len <= PAGE_SIZE) {
buff = new Uint8Array(len);

View File

@@ -30,7 +30,7 @@ export default class BigBuffer {
// bytes to copy from this page
const l = (o+r > PAGE_SIZE) ? (PAGE_SIZE -o) : r;
const srcView = new Uint8Array(this.buffers[p].buffer, this.buffers[p].byteOffset+o, l);
if (l == len) return srcView;
if (l == len) return srcView.slice();
if (!buff) {
if (len <= PAGE_SIZE) {
buff = new Uint8Array(len);