I’d much rather go with something simpler. `sort_by { |x| x[:short] || x[:long] }` would do the trick here as well and is equally valid.