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

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

[elpa] 02/02: [gnugo int] Use ‘pcase ’ more.


From: Thien-Thi Nguyen
Subject: [elpa] 02/02: [gnugo int] Use ‘pcase ’ more.
Date: Sat, 08 Mar 2014 13:16:24 +0000

ttn pushed a commit to branch master
in repository elpa.

commit 2597239926d0b58fd916a6e7921d056609d96496
Author: Thien-Thi Nguyen <address@hidden>
Date:   Sat Mar 8 14:20:09 2014 +0100

    [gnugo int] Use ‘pcase’ more.
    
    * gnugo.el (gnugo-move-history):
    ...here, instead of ‘if’ + ‘case’.
---
 packages/gnugo/gnugo.el |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index e5f28d8..b578f24 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -650,14 +650,13 @@ For all other values of RSEL, do nothing and return nil."
                            (length acc)
                            (mapconcat 'identity (nreverse acc) " ")))
          (finish (byp) (while (next byp)) (tell)))
-      (if (equal '(4) rsel)
-          (finish t)
-        (case rsel
-          ((nil) (finish nil))
-          (car              (car (next nil)))
-          (cadr  (next nil) (car (next nil)))
-          (count (aref (gnugo-get :monkey) 2))
-          (t nil))))))
+      (pcase rsel
+        (`(4) (finish t))
+        (`nil (finish nil))
+        (`car              (car (next nil)))
+        (`cadr  (next nil) (car (next nil)))
+        (`count (aref (gnugo-get :monkey) 2))
+        (_ nil)))))
 
 (defun gnugo-boss-is-near ()
   "Do `bury-buffer' until the current one is not a GNU Board."



reply via email to

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