style: compact inner groups and simple guard bodies

This commit is contained in:
2026-10-27 12:40:41 +01:00
parent f062389ccc
commit 8d1a98f982
22 changed files with 165 additions and 430 deletions
+2 -6
View File
@@ -70,9 +70,7 @@ alloc proc($T type, allocator Allocator, count usize) []mut T ! AllocError {
element_size :: sizeof!(T)
if (element_size == 0) return empty_slice(T, count)
if count > divtrunc!(maxval!(usize), element_size) {
return .out_of_memory
}
if (count > divtrunc!(maxval!(usize), element_size)) return .out_of_memory
memory :: raw_alloc(allocator, count * element_size, alignof!(T))
if memory |bytes| {
@@ -194,9 +192,7 @@ c_realloc proc(
}
if memory |old_memory| {
if alignment <= malloc_alignment {
return ptrcast!(c.realloc(old_memory, c_ulong(new_size)))
}
if (alignment <= malloc_alignment) return ptrcast!(c.realloc(old_memory, c_ulong(new_size)))
new_memory :: c_alloc(null, new_size, alignment)
if new_memory |new_bytes| {