if (target.length - target_start < end - start)
end = target.length - target_start + start
- // copy!
- for (var i = 0; i < end - start; i++)
- target[i + target_start] = this[i + start]
+ var len = end - start
+
+ if (len < 100 || !Buffer._useTypedArrays) {
+ for (var i = 0; i < len; i++)
+ target[i + target_start] = this[i + start]
+ } else {
+ target._set(new Uint8Array(this.buffer, start, len), target_start)
+ }
}
function _base64Slice (buf, start, end) {