renamed Array_slice macros

This commit is contained in:
Timerix 2025-11-08 18:13:06 +05:00
parent 00a1a29d34
commit 30c141f587
2 changed files with 7 additions and 7 deletions

View File

@ -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);
}

View File

@ -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];