diff options
author | red031000 <rubenru09@aol.com> | 2020-06-11 19:52:48 +0100 |
---|---|---|
committer | red031000 <rubenru09@aol.com> | 2020-06-11 19:52:48 +0100 |
commit | 3614b5a702af1aba1a0597fae4a5025d3fb9c413 (patch) | |
tree | f38c0f826863eca36ec436668592fdf744500850 /arm9/lib/src | |
parent | e6fd0961912649544d3d4eee185b2ac96b8233c3 (diff) |
arm7 OS_alloc
Diffstat (limited to 'arm9/lib/src')
-rw-r--r-- | arm9/lib/src/OS_alloc.c | 6 |
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;
|