new way of breaking. nice :)
This commit is contained in:
@@ -6,7 +6,7 @@ int main(void) {
|
||||
int *ints;
|
||||
set_init(&ints, allocator, .initial_capacity=20);
|
||||
map_print_mapping_state(ints, stdout);
|
||||
for ( int i = 0; i < 20; i++ ) {
|
||||
for ( int i = 0; i < 100; i++ ) {
|
||||
set_add(&ints, i);
|
||||
map_print_mapping_state(ints, stdout);
|
||||
}
|
||||
|
||||
@@ -100,9 +100,9 @@ void *map_create_func(
|
||||
return header->bytes;
|
||||
}
|
||||
|
||||
static const void *internal_cig_key_ptr_from_pair_ptr(const void *this, const void *pair) {
|
||||
static const uint8_t *internal_cig_key_ptr_from_pair_ptr(const void *this, const void *pair) {
|
||||
map_header_t *header = PTR_FROM_FIELD_PTR(map_header_t, bytes, this);
|
||||
return (const void *) &((const char *)pair)[header->key_offset];
|
||||
return (const uint8_t *) &((const char *)pair)[header->key_offset];
|
||||
}
|
||||
|
||||
// TODO: just make these internal probably
|
||||
@@ -143,7 +143,7 @@ unsigned int map_place(void *this, index_pair_t idx_pair) {
|
||||
|
||||
index_pair_t map_pair_hash(void *this, void *pair) {
|
||||
map_header_t *header = PTR_FROM_FIELD_PTR(map_header_t, bytes, this);
|
||||
const void *key = internal_cig_key_ptr_from_pair_ptr(this, pair);
|
||||
const uint8_t *key = internal_cig_key_ptr_from_pair_ptr(this, pair);
|
||||
|
||||
// find the initial index based on hash
|
||||
uint32_t mapping_index;
|
||||
|
||||
Reference in New Issue
Block a user