mirror of
https://github.com/samsonjs/lake.git
synced 2026-03-25 08:55:49 +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);
|
||||
}
|
||||
size_t i = list->n++;
|
||||
while (i--) {
|
||||
do {
|
||||
list->vals[i] = list->vals[i - 1];
|
||||
}
|
||||
} while (i--);
|
||||
list->vals[0] = val;
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue