fix: remove redundant manual increment of loop variable in List.toString
The for-in loop in Wren already increments the loop variable automatically, so the explicit `i = i + 1` inside the loop body was causing every other element to be skipped when building the string representation of a List. This fix removes the unnecessary increment from both the corelib.wren source and the embedded string in wren_core.c.
This commit is contained in:
@@ -61,7 +61,6 @@ const char* coreLibSource =
|
||||
" for (i in 0...this.count) {\n"
|
||||
" if (i > 0) result = result + \", \"\n"
|
||||
" result = result + this[i].toString\n"
|
||||
" i = i + 1\n"
|
||||
" }\n"
|
||||
" result = result + \"]\"\n"
|
||||
" return result\n"
|
||||
|
||||
Reference in New Issue
Block a user