[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 02/07: [gnugo int] Avoid double list-reverse.
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 02/07: [gnugo int] Avoid double list-reverse. |
Date: |
Sat, 05 Apr 2014 11:09:29 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit ea4e9b85cd1167271ad94dd7d477ac5a201efd9b
Author: Thien-Thi Nguyen <address@hidden>
Date: Sat Apr 5 10:15:08 2014 +0200
[gnugo int] Avoid double list-reverse.
* packages/gnugo/gnugo.el (gnugo-describe-internal-properties):
Use ‘do (push ...)’ instead of ‘collect’ in ‘loop’;
don't ‘reverse’ the result later.
---
packages/gnugo/gnugo.el | 36 +++++++++++++++++++-----------------
1 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index a097075..d061fde 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -250,22 +250,24 @@ Handle the big, slow-to-render, and/or uninteresting ones
specially."
(interactive)
(let ((buf (current-buffer))
(d (gnugo-get :diamond))
- (acc (loop for key being the hash-keys of gnugo-state
- using (hash-values val)
- collect (cons key
- (case key
- ((:xpms :local-xpms)
- (format "hash: %X (%d images)"
- (sxhash val)
- (length val)))
- (:sgf-collection
- (length val))
- (:monkey
- (let ((mem (aref val 0)))
- (list (aref val 1)
- (aref val 2)
- (car mem))))
- (t val))))))
+ acc)
+ (loop for key being the hash-keys of gnugo-state
+ using (hash-values val)
+ do (push (cons key
+ (case key
+ ((:xpms :local-xpms)
+ (format "hash: %X (%d images)"
+ (sxhash val)
+ (length val)))
+ (:sgf-collection
+ (length val))
+ (:monkey
+ (let ((mem (aref val 0)))
+ (list (aref val 1)
+ (aref val 2)
+ (car mem))))
+ (t val)))
+ acc))
(switch-to-buffer (get-buffer-create
(format "%s*GNUGO Board Properties*"
(gnugo-get :diamond))))
@@ -273,7 +275,7 @@ Handle the big, slow-to-render, and/or uninteresting ones
specially."
(emacs-lisp-mode)
(setq truncate-lines t)
(save-excursion
- (pp (reverse acc)
+ (pp acc
(current-buffer))
(goto-char (point-min))
(let ((rx (format "overlay from \\([0-9]+\\).+\n%s\\s-+"
- [elpa] branch master updated (0a73626 -> 3f390d3), Thien-Thi Nguyen, 2014/04/05
- [elpa] 02/07: [gnugo int] Avoid double list-reverse.,
Thien-Thi Nguyen <=
- [elpa] 03/07: [gnugo] Support SGF[4] parsing from string data., Thien-Thi Nguyen, 2014/04/05
- [elpa] 04/07: [gnugo int] Use ‘gnugo /sgf-create’ more., Thien-Thi Nguyen, 2014/04/05
- [elpa] 06/07: [gnugo int] Make ‘gnug o--no-regrets’ take ENDS directly., Thien-Thi Nguyen, 2014/04/05
- [elpa] 07/07: [gnugo] Declare dependency on ‘ascii-art-to-unicode’., Thien-Thi Nguyen, 2014/04/05
- [elpa] 05/07: [gnugo int] Add abstractions: gnugo--{, set-}tree-ends, Thien-Thi Nguyen, 2014/04/05
- [elpa] 01/07: [gnugo int] Specify STREAM to ‘pp’ directly., Thien-Thi Nguyen, 2014/04/05