renamed Array_slice macros
This commit is contained in:
parent
00a1a29d34
commit
30c141f587
@ -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))
|
#define struct_castTo_Array(STRUCT_PTR) Array_construct_size((STRUCT_PTR), sizeof(*STRUCT_PTR))
|
||||||
|
|
||||||
///@return a[0..n]
|
///@return a[0..i-1]
|
||||||
static inline Array(u8) Array_sliceBefore(Array(u8) a, u32 n){
|
static inline Array(u8) Array_sliceTo(Array(u8) a, u32 i){
|
||||||
return Array_construct_size(a.data, n);
|
return Array_construct_size(a.data, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
///@return a[n...]
|
///@return a[i...]
|
||||||
static inline Array(u8) Array_sliceAfter(Array(u8) a, u32 n){
|
static inline Array(u8) Array_sliceFrom(Array(u8) a, u32 i){
|
||||||
return Array_construct_size((u8*)a.data + n, a.size - n);
|
return Array_construct_size((u8*)a.data + i, a.size - i);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,7 +88,7 @@ void* NULLABLE(HashMap_tryGetPtr)(HashMap_* ptr, str key){
|
|||||||
|
|
||||||
static void __HashMap_expand(HashMap_* ptr){
|
static void __HashMap_expand(HashMap_* ptr){
|
||||||
u32 height_expanded_n = ptr->height_n + 1;
|
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
|
// alloc new HashMapBucket array
|
||||||
u32 height_expanded = ((u32*)__HashMap_heights.data)[height_expanded_n];
|
u32 height_expanded = ((u32*)__HashMap_heights.data)[height_expanded_n];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user