From 3614b5a702af1aba1a0597fae4a5025d3fb9c413 Mon Sep 17 00:00:00 2001 From: red031000 Date: Thu, 11 Jun 2020 19:52:48 +0100 Subject: arm7 OS_alloc --- arm9/lib/src/OS_alloc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'arm9/lib/src/OS_alloc.c') 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; -- cgit v1.2.3