Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "bops", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "buffer operations", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,2 +9,19 @@ module.exports = copy | ||
source_end = arguments.length < 5 ? source.length : source_end | ||
if(source_end === source_start) { | ||
return | ||
} | ||
if(target.length === 0 || source.length === 0) { | ||
return | ||
} | ||
if(source_end > source.length) { | ||
source_end = source.length | ||
} | ||
if(target.length - target_start < source_end - source_start) { | ||
source_end = target.length - target_start + start | ||
} | ||
if(source.buffer !== target.buffer) { | ||
@@ -17,7 +34,9 @@ return fast_copy(source, target, target_start, source_start, source_end) | ||
function fast_copy(source, target, target_start, source_start, source_end) { | ||
for(var i = target_start, len = source_end - source_start + target_start, j = source_start; | ||
var len = (source_end - source_start) + target_start | ||
for(var i = target_start, j = source_start; | ||
i < len; | ||
++i, | ||
++j) { | ||
target[j] = source[i] | ||
target[i] = source[j] | ||
} | ||
@@ -24,0 +43,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20492
560