Tiny suggestion



in glib/ghash.c (g_hash_table_resize), instead of:

  nodes_per_list = (gfloat) hash_table->nnodes / (gfloat)
hash_table->size;

  if ((nodes_per_list > 0.3 || hash_table->size <= HASH_TABLE_MIN_SIZE)
&&
      (nodes_per_list < 3.0 || hash_table->size >= HASH_TABLE_MAX_SIZE))
    return;

we could have:

  if (((hash_table->nnodes<<1) > hash_table->size ||
        hash_table->size <= HASH_TABLE_MIN_SIZE)&&
      (hash_table->nnodes < (hash_table->size << 1) ||
        hash_table->size >= HASH_TABLE_MAX_SIZE))
    return;

Would this speed things up any?

Mick.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]