From 01fe9f2eeab8b54487a4673e74851160adb1718d Mon Sep 17 00:00:00 2001 From: Fabrice Date: Mon, 2 Mar 2026 12:43:25 +0100 Subject: working on array implementation --- src/common.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/common.cc') diff --git a/src/common.cc b/src/common.cc index df8b9aa..36ddbeb 100644 --- a/src/common.cc +++ b/src/common.cc @@ -44,8 +44,8 @@ typedef intptr_t isize; #define spanic(msg) panic("%s", msg) #undef assert -#define assert(cond) \ - do { \ +#define assert(cond) \ + do { \ if (unlikely(!(cond))) panic("assertion failed: %s", #cond); \ } while (0) @@ -102,7 +102,7 @@ static inline void link_after(Link* prev, Link* nlink) { nlink->next = next; prev->next = nlink; - if(next == nullptr) return; + if (next == nullptr) return; next->prev = nlink; } @@ -112,11 +112,9 @@ static inline void link_remove(Link* item) { Link* prev = item->prev; Link* next = item->next; - if(prev != nullptr) - prev->next = next; + if (prev != nullptr) prev->next = next; - if(next != nullptr) - next->prev = prev; + if (next != nullptr) next->prev = prev; item->prev = item->next = nullptr; } -- cgit v1.2.3