mirror of
https://github.com/asadbek064/hyparquet.git
synced 2026-01-04 18:46:37 +00:00
Remove selfCopyBytes in favor of copyBytes
This commit is contained in:
parent
2cd582ea5a
commit
a9467f6c3d
@ -22,21 +22,6 @@ function copyBytes(fromArray, fromPos, toArray, toPos, length) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy bytes within an array
|
||||
*
|
||||
* @param {Uint8Array} array source and destination array
|
||||
* @param {number} pos source position
|
||||
* @param {number} offset offset back from current position to read
|
||||
* @param {number} length number of bytes to copy
|
||||
* @returns {void}
|
||||
*/
|
||||
function selfCopyBytes(array, pos, offset, length) {
|
||||
for (let i = 0; i < length; i++) {
|
||||
array[pos + i] = array[pos - offset + i]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decompress snappy data.
|
||||
* Accepts an output buffer to avoid allocating a new buffer for each call.
|
||||
@ -135,7 +120,7 @@ export function snappyUncompress(input, output) {
|
||||
if (offset > outPos) {
|
||||
throw new Error('cannot copy from before start of buffer')
|
||||
}
|
||||
selfCopyBytes(output, outPos, offset, len)
|
||||
copyBytes(output, outPos - offset, output, outPos, len)
|
||||
outPos += len
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user