Permalink
Browse files

Transform an unneded case statement into an if statement.

  • Loading branch information...
1 parent 37bae51 commit f52d33ec43a293b3bf2a8e8aa7729aadd0d22aed @nonsequitur committed Sep 4, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 inf-ruby.el
View
@@ -347,11 +347,11 @@ Then switch to the process buffer."
(if inf-ruby-at-top-level-prompt-p
(let* ((curr (replace-regexp-in-string "\n$" "" (thing-at-point 'line)))
(completions (inf-ruby-completions curr)))
- (case (length completions)
- (0 nil)
- (1 (car completions))
- (t (completing-read "possible completions: "
- completions nil t curr))))
+ (if completions
+ (if (= (length completions) 1)
+ (car completions)
+ (completing-read "possible completions: "
+ completions nil t curr))))
(message "Completion aborted: Not at a top-level prompt")
nil))

0 comments on commit f52d33e

Please sign in to comment.