[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 01/01: [gnugo int] Fix bug: Update local var ‘ends’ when branchi
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 01/01: [gnugo int] Fix bug: Update local var ‘ends’ when branching. |
Date: |
Thu, 10 Apr 2014 09:50:45 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit 3a06ecab26982c95544177281fff72fdef7323c9
Author: Thien-Thi Nguyen <address@hidden>
Date: Thu Apr 10 11:46:41 2014 +0200
[gnugo int] Fix bug: Update local var ‘ends’ when branching.
Omission from 2014-04-05, "Expand gametree IR: MNUM, KIDS, ROOT".
Note the unheeded hint: "hmm, probably unnecessary" -- d'oh!
* packages/gnugo/gnugo.el (gnugo--set-tree-ends): Return the new ends.
(gnugo-note): Update local var ‘ends’ w/ ‘gnugo--set-tree-ends’ rv.
---
packages/gnugo/gnugo.el | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index bf63536..f9f9e99 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -261,8 +261,7 @@ See `gnugo-put'."
(defsubst gnugo--set-tree-ends (tree ls)
(aset tree 2 (apply 'vector ls))
- ;; hmm, probably unnecessary
- tree)
+ (gnugo--tree-ends tree))
(defun gnugo-describe-internal-properties ()
"Pretty-print `gnugo-state' properties in another buffer.
@@ -1175,11 +1174,11 @@ This fails if the monkey is on the current branch
finally do
(progn
(unless (gnugo--no-regrets monkey ends)
- (gnugo--set-tree-ends
- tree (let ((ls (append ends nil)))
- ;; copy old to the right of new
- (push mem (nthcdr bidx ls))
- ls)))
+ (setq ends (gnugo--set-tree-ends
+ tree (let ((ls (append ends nil)))
+ ;; copy old to the right of new
+ (push mem (nthcdr bidx ls))
+ ls))))
(puthash fruit (1+ (gethash tip mnum)) mnum)
(push fruit mem)
(aset ends bidx mem)))