From 30c141f587ac8fa635812c6f4713dbc20b18d7c9 Mon Sep 17 00:00:00 2001 From: Timerix Date: Sat, 8 Nov 2025 18:13:06 +0500 Subject: [PATCH] renamed Array_slice macros --- include/tlibc/collections/Array.h | 12 ++++++------ src/collections/HashMap.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/tlibc/collections/Array.h b/include/tlibc/collections/Array.h index 37814dd..70b529e 100755 --- a/include/tlibc/collections/Array.h +++ b/include/tlibc/collections/Array.h @@ -38,12 +38,12 @@ static inline Array_ Array_copy(Array_ src){ #define struct_castTo_Array(STRUCT_PTR) Array_construct_size((STRUCT_PTR), sizeof(*STRUCT_PTR)) -///@return a[0..n] -static inline Array(u8) Array_sliceBefore(Array(u8) a, u32 n){ - return Array_construct_size(a.data, n); +///@return a[0..i-1] +static inline Array(u8) Array_sliceTo(Array(u8) a, u32 i){ + return Array_construct_size(a.data, i); } -///@return a[n...] -static inline Array(u8) Array_sliceAfter(Array(u8) a, u32 n){ - return Array_construct_size((u8*)a.data + n, a.size - n); +///@return a[i...] +static inline Array(u8) Array_sliceFrom(Array(u8) a, u32 i){ + return Array_construct_size((u8*)a.data + i, a.size - i); } diff --git a/src/collections/HashMap.c b/src/collections/HashMap.c index e3608bd..b9bcfcc 100755 --- a/src/collections/HashMap.c +++ b/src/collections/HashMap.c @@ -88,7 +88,7 @@ void* NULLABLE(HashMap_tryGetPtr)(HashMap_* ptr, str key){ static void __HashMap_expand(HashMap_* ptr){ u32 height_expanded_n = ptr->height_n + 1; - assert(height_expanded_n < Array_len(&__HashMap_heights, u32) && "HashMap IS FULL! Fix your code."); + assert(height_expanded_n < Array_len(__HashMap_heights, u32) && "HashMap IS FULL! Fix your code."); // alloc new HashMapBucket array u32 height_expanded = ((u32*)__HashMap_heights.data)[height_expanded_n];