Optimized stream.js / 9-10x faster DecodeStream_ensureBuffer

This commit is contained in:
p01 2014-05-06 16:45:49 +02:00
parent 8cfd024e48
commit 330b99f428

View File

@ -144,8 +144,8 @@ var DecodeStream = (function DecodeStreamClosure() {
size *= 2;
}
var buffer2 = new Uint8Array(size);
for (var i = 0; i < current; ++i) {
buffer2[i] = buffer[i];
if (buffer) {
buffer2.set(buffer);
}
return (this.buffer = buffer2);
},