summaryrefslogtreecommitdiff
path: root/arm9/lib/src/OS_alloc.c
diff options
context:
space:
mode:
authorRevo <projectrevotpp@hotmail.com>2020-06-11 15:26:48 -0400
committerGitHub <noreply@github.com>2020-06-11 15:26:48 -0400
commite2d7f9f796889087a3da50f7eeb2383731ca3262 (patch)
tree7b33b62505f843f9c898d3c95ab79f73f552141f /arm9/lib/src/OS_alloc.c
parenteff79df215fc70712bbb396126d74aa07c8d4a91 (diff)
parent01a4752a7e17ddc14de83fff9c03048f73c97788 (diff)
Merge pull request #158 from red031000/master
arm7 OS_alloc
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;