rendered paste bodyvalue_t** remap_freq_htable(htable_t* htable){ printf ("--- Remap freq table! ---\n"); /* First sort table */ insertion_sort( htable->array, htable->buckets, &cntcmphash ); htable->buckets = htable->items; /* Remap the ids */ int i = 0; for (i=0; i<htable->buckets; i++) { if (htable->array[i] != NULL) { htable->array[i]->id = i; } } value_t** narray = (value_t**) safe_malloc( sizeof(value_t**) * htable->items ); i = 0; while ( htable->array[i] != NULL ) { narray[i] = htable->array[i]; i++; } return narray;}