mirror of
https://github.com/zekexiao/pocketlang.git
synced 2025-02-05 20:26:53 +08:00
fix(bench): do not double-reverse in list.js
file (#133)
This commit is contained in:
parent
aba0546c2a
commit
6ce5c9f57e
@ -1,6 +1,9 @@
|
||||
function reverse(list) {
|
||||
var i=0, tmp, idx, count=list.length;
|
||||
for (; i < count; i++) {
|
||||
var i=0, tmp, idx;
|
||||
var count = list.length;
|
||||
var max = count / 2 | 0;
|
||||
|
||||
for (; i < max; i++) {
|
||||
idx = count - i - 1;
|
||||
tmp = list[idx];
|
||||
list[idx] = list[i];
|
||||
|
Loading…
Reference in New Issue
Block a user