summaryrefslogtreecommitdiff
path: root/arm9/lib/src
diff options
context:
space:
mode:
authorred031000 <rubenru09@aol.com>2020-06-11 19:52:48 +0100
committerred031000 <rubenru09@aol.com>2020-06-11 19:52:48 +0100
commit3614b5a702af1aba1a0597fae4a5025d3fb9c413 (patch)
treef38c0f826863eca36ec436668592fdf744500850 /arm9/lib/src
parente6fd0961912649544d3d4eee185b2ac96b8233c3 (diff)
arm7 OS_alloc
Diffstat (limited to 'arm9/lib/src')
-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;