emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/inf-ruby f52d33ec43 016/265: Transform an unneded case sta


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby f52d33ec43 016/265: Transform an unneded case statement into an if statement.
Date: Sat, 9 Jul 2022 21:59:10 -0400 (EDT)

branch: elpa/inf-ruby
commit f52d33ec43a293b3bf2a8e8aa7729aadd0d22aed
Author: Cornelius Mika <cornelius.mika@gmail.com>
Commit: Cornelius Mika <cornelius.mika@gmail.com>

    Transform an unneded case statement into an if statement.
---
 inf-ruby.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index ebb6389b83..544c7beeca 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -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))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]