src/container.c
// Insert an item to a map.
Insert an item to a map.
Insert an item to a map .
void map_insert(Map *map, char *key, void *val) {
    for (int i = 0; i < map->len; i++) {
        if (!strcmp(vec_at(map->keys, i), key)) {
            map->vals->data[i] = val;
            return;
        }
    }
    vec_push(map->keys, key);
    vec_push(map->vals, val);
    map->len++;
}
void map_insert ( Map * map , char * key , void * val ) { for ( int i = 0 ; i < map -> len ; i ++ ) { if ( ! strcmp ( vec_at ( map -> keys , i ) , key ) ) { map -> vals -> data [ i ] = val ; return ; } } vec_push ( map -> keys , key ) ; vec_push ( map -> vals , val ) ; map -> len ++ ; }
Insert an item to a map.
Insert an item to a map .