mirror of
https://github.com/samsonjs/lake.git
synced 2026-04-27 14:57:43 +00:00
fix unshift
This commit is contained in:
parent
1bcf043f86
commit
42f982f9ef
1 changed files with 2 additions and 2 deletions
|
|
@ -146,9 +146,9 @@ LakeVal *list_unshift(LakeList *list, LakeVal *val)
|
||||||
list_grow(list);
|
list_grow(list);
|
||||||
}
|
}
|
||||||
size_t i = list->n++;
|
size_t i = list->n++;
|
||||||
while (i--) {
|
do {
|
||||||
list->vals[i] = list->vals[i - 1];
|
list->vals[i] = list->vals[i - 1];
|
||||||
}
|
} while (i--);
|
||||||
list->vals[0] = val;
|
list->vals[0] = val;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue