branch: elpa/pacmacs
commit 4ce9773129536b635474ac7466d4b7b9e0eb4458
Merge: 8166e4d3d7 2425a26d88
Author: Alexey Kutepov <[email protected]>
Commit: Alexey Kutepov <[email protected]>
Merge pull request #183 from codingteam/push-instead-of-add-to-list-182
Use push instead of add-to-list
---
pacmacs.el | 12 ++++++------
tools/pacmacs-rr.el | 9 ++++-----
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/pacmacs.el b/pacmacs.el
index 84e60017cc..4f79cf8427 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -450,8 +450,8 @@
(defun pacmacs--unterrify-timed-out-ghosts ()
(dolist (terrified-ghost (-filter #'pacmacs--terrified-ghost-timed-out-p
pacmacs--terrified-ghosts))
- (add-to-list 'pacmacs--ghosts
- (pacmacs--unterrify-ghost terrified-ghost)))
+ (push (pacmacs--unterrify-ghost terrified-ghost)
+ pacmacs--ghosts))
(setq pacmacs--terrified-ghosts
(-remove #'pacmacs--terrified-ghost-timed-out-p
@@ -697,19 +697,19 @@
for line being the element of lines using (index row)
do (cl-loop for x being the element of line using (index column)
do (cond ((char-equal x ?#)
- (add-to-list 'pacmacs--wall-cells
(pacmacs--make-wall-cell row column)))
+ (push (pacmacs--make-wall-cell row column)
pacmacs--wall-cells))
((char-equal x ?.)
- (add-to-list 'pacmacs--pills
(pacmacs--make-regular-pill row column)))
+ (push (pacmacs--make-regular-pill row column)
pacmacs--pills))
((char-equal x ?+)
- (add-to-list 'pacmacs--pills
(pacmacs--make-big-pill row column)))
+ (push (pacmacs--make-big-pill row column)
pacmacs--pills))
((char-equal x ?o)
(setq pacmacs--player-state (pacmacs--make-player
row column)))
((char-equal x ?g)
- (add-to-list 'pacmacs--ghosts (pacmacs--make-ghost
row column))))))
+ (push (pacmacs--make-ghost row column)
pacmacs--ghosts)))))
(pacmacs--fill-object-board)
diff --git a/tools/pacmacs-rr.el b/tools/pacmacs-rr.el
index dfef184645..b85b0b3a78 100644
--- a/tools/pacmacs-rr.el
+++ b/tools/pacmacs-rr.el
@@ -45,8 +45,8 @@
(defvar pacmacs-replay-finished-hook nil)
(defun pacmacs--record-action (action-name)
- (add-to-list 'pacmacs--recorded-actions
- (cons action-name pacmacs--tick-counter)))
+ (push (cons action-name pacmacs--tick-counter)
+ pacmacs--recorded-actions))
(defun pacmacs--reset-recorder ()
(setq pacmacs--tick-counter 0)
@@ -94,9 +94,8 @@
(defun pacmacs-replay-tick ()
(cl-incf pacmacs--tick-counter)
- (add-to-list 'pacmacs--tick-times
- (pacmacs--measure-time
- (pacmacs-tick)))
+ (push (pacmacs--measure-time (pacmacs-tick))
+ pacmacs--tick-times)
(if pacmacs--recorded-actions
(-let ((((action . tick-number) . _) pacmacs--recorded-actions))