@@ -871,19 +871,17 @@ secondary_hash(st_index_t ind, st_table *tab, st_index_t *perterb)
871
871
static inline st_index_t
872
872
find_entry (st_table * tab , st_hash_t hash_value , st_data_t key )
873
873
{
874
- int eq_p , rebuilt_p ;
875
- st_index_t i , bound ;
876
- st_table_entry * entries ;
874
+ unsigned short int eq_p , rebuilt_p ;
877
875
878
- bound = tab -> entries_bound ;
879
- entries = tab -> entries ;
880
- for (i = tab -> entries_start ; i < bound ; i ++ ) {
881
- DO_PTR_EQUAL_CHECK (tab , & entries [i ], hash_value , key , eq_p , rebuilt_p );
882
- if (EXPECT (rebuilt_p , 0 ))
883
- return REBUILT_TABLE_ENTRY_IND ;
884
- if (eq_p )
885
- return i ;
876
+ for (st_index_t i = tab -> entries_start ; i < tab -> entries_bound ; i ++ ) {
877
+ DO_PTR_EQUAL_CHECK (tab , & tab -> entries [i ], hash_value , key , eq_p , rebuilt_p );
878
+
879
+ if (EXPECT (rebuilt_p , 0 ))
880
+ return REBUILT_TABLE_ENTRY_IND ;
881
+ if (eq_p )
882
+ return i ;
886
883
}
884
+
887
885
return UNDEFINED_ENTRY_IND ;
888
886
}
889
887
@@ -898,29 +896,25 @@ find_entry(st_table *tab, st_hash_t hash_value, st_data_t key)
898
896
static st_index_t
899
897
find_table_entry_ind (st_table * tab , st_hash_t hash_value , st_data_t key )
900
898
{
901
- int eq_p , rebuilt_p ;
902
- st_index_t ind ;
903
- #ifdef QUADRATIC_PROBE
904
- st_index_t d ;
905
- #else
906
- st_index_t peterb ;
907
- #endif
908
- st_index_t bin ;
909
- st_table_entry * entries = tab -> entries ;
910
-
911
899
st_assert (tab != NULL );
912
900
st_assert (tab -> bins != NULL );
913
- ind = hash_bin (hash_value , tab );
901
+
902
+ unsigned short int eq_p , rebuilt_p ;
903
+ st_index_t ind = hash_bin (hash_value , tab );
904
+ st_index_t bin ;
914
905
#ifdef QUADRATIC_PROBE
915
- d = 1 ;
906
+ st_index_t d = 1 ;
916
907
#else
917
- peterb = hash_value ;
908
+ st_index_t peterb = hash_value ;
918
909
#endif
919
910
FOUND_BIN ;
911
+
920
912
for (;;) {
921
913
bin = get_bin (tab -> bins , get_size_ind (tab ), ind );
914
+
922
915
if (! EMPTY_OR_DELETED_BIN_P (bin )) {
923
- DO_PTR_EQUAL_CHECK (tab , & entries [bin - ENTRY_BASE ], hash_value , key , eq_p , rebuilt_p );
916
+ DO_PTR_EQUAL_CHECK (tab , & tab -> entries [bin - ENTRY_BASE ], hash_value , key , eq_p , rebuilt_p );
917
+
924
918
if (EXPECT (rebuilt_p , 0 ))
925
919
return REBUILT_TABLE_ENTRY_IND ;
926
920
if (eq_p )
0 commit comments