All pastes #2059644 Raw Edit

Mine

public c v1 · immutable
#2059644 ·published 2011-05-15 05:21 UTC
rendered paste body
value_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;}