Skip to content

Commit cce211b

Browse files
committed
Fix vertex iteration in JS bindings to use forward loop for improved clarity
1 parent 03855c9 commit cce211b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libnest2d_js/libnest2d_js.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ std::vector<Point> jsArrayToPointVector(const emscripten::val& jsArray) {
6363
unsigned length = jsArray["length"].as<unsigned>();
6464
vertices.reserve(length);
6565

66-
for (int i = static_cast<int>(length) - 1; i >= 0; --i) {
66+
for (unsigned i = 0; i < length; i++) {
6767
emscripten::val jsPoint = jsArray[i];
6868
// Use property access instead of method calls for better compatibility
6969
long x = jsPoint["x"].as<long>();

0 commit comments

Comments
 (0)