[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 0d62e0346a 427/472: Remove redundant score sorting
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 0d62e0346a 427/472: Remove redundant score sorting (#194) |
Date: |
Thu, 6 Jan 2022 21:59:45 -0500 (EST) |
branch: elpa/pacmacs
commit 0d62e0346a61aabb9246da3334abd0295514554f
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Remove redundant score sorting (#194)
---
pacmacs-score.el | 22 ++++++++++------------
pacmacs.el | 3 +--
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/pacmacs-score.el b/pacmacs-score.el
index a76282e223..50b1381eb9 100644
--- a/pacmacs-score.el
+++ b/pacmacs-score.el
@@ -50,23 +50,23 @@
(let ((inhibit-read-only t))
(erase-buffer)
(-> (pacmacs--read-score-table)
- (pacmacs--sort-score-table)
(pacmacs--render-score-table)))))
(defun pacmacs--read-score-table ()
(when (file-exists-p pacmacs--score-file-name)
- (-> pacmacs--score-file-name
- (f-read-text)
- (read-from-string)
- (car)
- (pacmacs--sort-score-table))))
+ (->> pacmacs--score-file-name
+ (f-read-text)
+ (read-from-string)
+ (car)
+ (pacmacs--sort-score-table))))
(defun pacmacs--write-score-table (score-table)
(with-temp-buffer
- (-> score-table
- (pacmacs--sort-score-table)
- (pp-to-string)
- (insert))
+ (->> score-table
+ (pacmacs--sort-score-table)
+ (-take pacmacs--max-score-table-size)
+ (pp-to-string)
+ (insert))
(write-file pacmacs--score-file-name)))
(defun pacmacs--sort-score-table (score-table)
@@ -85,8 +85,6 @@
(defun pacmacs--add-entry-to-score-table (nickname score)
(->> (pacmacs--read-score-table)
(cons (cons nickname score))
- (pacmacs--sort-score-table)
- (-take pacmacs--max-score-table-size)
(pacmacs--write-score-table)))
(defun pacmacs--render-score-record (record)
diff --git a/pacmacs.el b/pacmacs.el
index 2e5df3a255..0ac35b98d8 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -585,8 +585,7 @@
(with-current-buffer pacmacs-buffer-name
(goto-char (point-max))
- (let* ((score-table (pacmacs--sort-score-table
- (pacmacs--read-score-table)))
+ (let* ((score-table (pacmacs--read-score-table))
(new-score-position (pacmacs--position-of-new-score
score-table
pacmacs-score)))
- [nongnu] elpa/pacmacs 54e77a2d10 408/472: Use Emacs Widget Library to ask nickname (#134), (continued)
- [nongnu] elpa/pacmacs 54e77a2d10 408/472: Use Emacs Widget Library to ask nickname (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 92eeeae98e 407/472: Ask for nickname at Game Over page (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 76f2dbe41b 409/472: Do nick padding inside of the widget (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 54be118510 413/472: Remove pacmacs-game-over-mode (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 429294ea94 416/472: Fix render-score-table UT (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d6260cd30c 417/472: Refactor nickname submission action (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 71ffcfb208 419/472: Add UT for align-score-record-nickname func (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 861aa9543e 422/472: Add UT for make-wall-cell func, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 2e881d27e0 424/472: Remove commented chunk of code (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 1e4cbd5f4f 426/472: Sort score table on reading and writing (#194), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0d62e0346a 427/472: Remove redundant score sorting (#194),
ELPA Syncer <=
- [nongnu] elpa/pacmacs 9b2c497eb9 431/472: Handle error during level list loading (#191), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 2cf174ca7e 434/472: Create signs folder with game over sign (#191), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7d4356c92c 445/472: Implement pacmacs-score-awesome (#203), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0f4eb7aebf 452/472: Decouple score page render from sign render (#203), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs a12795e835 455/472: Introduce pacmacs-scores-mode (#203), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs cdae42dba5 461/472: Replace too specific function with composition, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 864fe2b02e 465/472: Bump the copyright year for all the files, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs edadbe5e53 469/472: Bump version to 0.1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs db16fba9cd 470/472: Add missing license statement, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 98ce700143 023/472: Hide cursor in the game's buffer. Close #12, ELPA Syncer, 2022/01/06