Skip to content

Commit

Permalink
Use a ternary to make a more compact conditional
Browse files Browse the repository at this point in the history
Signed-off-by: Wincent Colaiuta <win@wincent.com>
  • Loading branch information
wincent committed Oct 8, 2010
1 parent a479297 commit c4d5c9d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ruby/command-t/controller.rb
Expand Up @@ -95,11 +95,7 @@ def accept_selection options = {}

def toggle_focus
@focus.unfocus # old focus
if @focus == @prompt
@focus = @match_window
else
@focus = @prompt
end
@focus = @focus == @prompt ? @match_window : @prompt
@focus.focus # new focus
end

Expand Down

0 comments on commit c4d5c9d

Please sign in to comment.