@@ -594,14 +594,18 @@ struct fstring_table_probe {
594594 int mask ;
595595};
596596
597- static int fstring_table_probe_start (struct fstring_table_probe * probe , struct fstring_table_struct * table , VALUE hash_code ) {
597+ static int
598+ fstring_table_probe_start (struct fstring_table_probe * probe , struct fstring_table_struct * table , VALUE hash_code )
599+ {
598600 RUBY_ASSERT ((table -> capacity & (table -> capacity - 1 )) == 0 );
599601 probe -> mask = table -> capacity - 1 ;
600602 probe -> idx = hash_code & probe -> mask ;
601603 return probe -> idx ;
602604}
603605
604- static int fstring_table_probe_next (struct fstring_table_probe * probe ) {
606+ static int
607+ fstring_table_probe_next (struct fstring_table_probe * probe )
608+ {
605609 probe -> idx = (probe -> idx + 1 ) & probe -> mask ;
606610 return probe -> idx ;
607611}
@@ -769,22 +773,26 @@ fstring_find_or_insert(VALUE hash_code, VALUE value, struct fstr_update_arg *arg
769773
770774 RB_GC_GUARD (table_obj );
771775 return value ;
772- } else {
776+ }
777+ else {
773778 // Nothing was inserted
774779 RUBY_ATOMIC_DEC (table -> count ); // we didn't end up inserting
775780
776781 // Another thread won the race, try again at the same location
777782 continue ;
778783 }
779- } else if (candidate == FSTRING_TABLE_TOMBSTONE ) {
784+ }
785+ else if (candidate == FSTRING_TABLE_TOMBSTONE ) {
780786 // Deleted entry, continue searching
781- } else if (candidate == FSTRING_TABLE_MOVED ) {
787+ }
788+ else if (candidate == FSTRING_TABLE_MOVED ) {
782789 // Wait
783790 RB_VM_LOCK_ENTER ();
784791 RB_VM_LOCK_LEAVE ();
785792
786793 goto retry ;
787- } else {
794+ }
795+ else {
788796 VALUE candidate_hash = RUBY_ATOMIC_VALUE_LOAD (entry -> hash );
789797 if ((candidate_hash == hash_code || candidate_hash == 0 ) && !fstring_cmp (candidate , value )) {
790798 // We've found a match
@@ -794,7 +802,8 @@ fstring_find_or_insert(VALUE hash_code, VALUE value, struct fstr_update_arg *arg
794802 RUBY_ATOMIC_VALUE_CAS (entry -> str , candidate , FSTRING_TABLE_TOMBSTONE );
795803
796804 // Fall through and continue our search
797- } else {
805+ }
806+ else {
798807 RB_GC_GUARD (table_obj );
799808 return candidate ;
800809 }
@@ -828,7 +837,8 @@ fstring_delete(VALUE hash_code, VALUE value)
828837 if (candidate == FSTRING_TABLE_EMPTY ) {
829838 // We didn't find our string to delete
830839 return ;
831- } else if (candidate == value ) {
840+ }
841+ else if (candidate == value ) {
832842 // We found our string, replace it with a tombstone and increment the count
833843 entry -> str = FSTRING_TABLE_TOMBSTONE ;
834844 table -> deleted_entries ++ ;
0 commit comments