Commits

Anonymous committed 7ce3343

Got rid of existing_key in fc_solve_hash_insert - it was not used.

  • Participants
  • Parent commits a0eadc3

Comments (0)

Files changed (3)

black-hole-solitaire/c-solver/black_hole_solver.c

     bhs_state_key_value_pair_t * init_state;
     bhs_state_key_value_pair_t state;
     bhs_state_key_value_pair_t next_state;
-#if (! (BHS_STATE_STORAGE == BHS_STATE_STORAGE_TOKYO_CAB_HASH))
-    bhs_state_key_value_pair_t * init_state_existing;
-#endif
 
     int four_cols_idx, four_cols_offset;
     bhs_state_key_value_pair_t * queue;
         &(solver->positions),
         init_state
 #if (! (BHS_STATE_STORAGE == BHS_STATE_STORAGE_TOKYO_CAB_HASH))
-        , &init_state_existing
         , perl_hash_function(((ub1 *)&(init_state->key)), sizeof(init_state->key))
 #endif
     );
                         &(solver->positions),
                         &next_state
 #if (! (BHS_STATE_STORAGE == BHS_STATE_STORAGE_TOKYO_CAB_HASH))
-                        , &init_state_existing
                         , perl_hash_function(((ub1 *)&(next_state.key)), 
                             sizeof(next_state.key))
 #endif

black-hole-solitaire/c-solver/fcs_hash.c

 fcs_bool_t bh_solve_hash_insert(
     bh_solve_hash_t * hash,
     bhs_state_key_value_pair_t * key,
-    bhs_state_key_value_pair_t * * existing_key,
     bh_solve_hash_value_t hash_value
 #ifdef FCS_ENABLE_SECONDARY_HASH_VALUE
     , bh_solve_hash_value_t secondary_hash_value
                 (!memcmp(&(item->key.key), &(key->key), sizeof(bhs_state_key_t)))
                )
             {
-                *existing_key = &(item->key);
-
                 return TRUE;
             }
             /* Cache the item before the current in last_item */
         bh_solve_hash_rehash(hash);
     }
 
-    *existing_key = NULL;
-
     return FALSE;
 }
 

black-hole-solitaire/c-solver/fcs_hash.h

 
 /*
  * Returns FALSE if the key is new and the key/val pair was inserted.
- *      - in that case *existing_key / *existing_val will be set to key
- *      and val respectively.
  * Returns TRUE if the key is not new and *existing_key / *existing_val
  * was set to it.
  */
 extern fcs_bool_t bh_solve_hash_insert(
     bh_solve_hash_t * hash,
     bhs_state_key_value_pair_t * key,
-    bhs_state_key_value_pair_t * * existing_key,
     bh_solve_hash_value_t hash_value
 #ifdef FCS_ENABLE_SECONDARY_HASH_VALUE
     , bh_solve_hash_value_t secondary_hash_value