Skip to content

Commit 361c647

Browse files
📚 docs(sortFloat32): Mention buffer boundaries in TODO comment.
1 parent 317e907 commit 361c647

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/array/api/sortFloat32.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const iFloatFlip = (f) => {
1313
};
1414

1515
const sortFloat32 = (array) => {
16-
const buffer = Float32Array.from(array).buffer; // TODO avoid copying when passed a Float32Array
16+
// TODO avoid copying when passed a Float32Array
17+
// but be careful to take into account byteOffset, byteLength, and length
18+
const buffer = Float32Array.from(array).buffer;
1719
const view = new Uint32Array(buffer);
1820
const N = array.length;
1921
for (let i = 0; i < N; ++i) view[i] = floatFlip(view[i]);

0 commit comments

Comments
 (0)