summaryrefslogtreecommitdiff
path: root/arm9/lib/src/OS_alloc.c
diff options
context:
space:
mode:
authorEgor Ananyin <ananinegor@gmail.com>2020-06-12 09:06:23 +0300
committerEgor Ananyin <ananinegor@gmail.com>2020-06-12 09:06:23 +0300
commit10c763389f50e38572c71b7c482005ec5f1655e7 (patch)
treefc20d0fcc5df7a977647c4d0cbe6cd4899f52431 /arm9/lib/src/OS_alloc.c
parentc0793478b0fdfcf314f5ff58e46c3ac88bf46525 (diff)
parente2d7f9f796889087a3da50f7eeb2383731ca3262 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'arm9/lib/src/OS_alloc.c')
-rw-r--r--arm9/lib/src/OS_alloc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arm9/lib/src/OS_alloc.c b/arm9/lib/src/OS_alloc.c
index 32f386a8..00028d3c 100644
--- a/arm9/lib/src/OS_alloc.c
+++ b/arm9/lib/src/OS_alloc.c
@@ -35,14 +35,12 @@ ARM_FUNC Cell *DLInsert(Cell *original, Cell *inserted)
{
Cell *prevCell = NULL;
Cell *nextCell = original;
-
- while (nextCell != NULL)
+
+ for (nextCell = original, prevCell = NULL; nextCell; prevCell = nextCell, nextCell = nextCell->next)
{
if (inserted <= nextCell)
break;
- prevCell = nextCell;
- nextCell = nextCell->next;
}
inserted->next = nextCell;