avoiding calling of #option_value_selected? two times
Merge pull request #13027 from akshay-vishnoi/f-refactor

avoiding calling of #option_value_selected? two times