[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pam 0f1f5cf265 10/16: Use cl-loop instead of queue pack
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pam 0f1f5cf265 10/16: Use cl-loop instead of queue package |
Date: |
Wed, 20 Sep 2023 12:59:11 -0400 (EDT) |
branch: externals/pam
commit 0f1f5cf265f0f6baa1848d57a9642985b75f82d0
Author: Onnie Lynn Winebarger <owinebar@gmail.com>
Commit: Onnie Lynn Winebarger <owinebar@gmail.com>
Use cl-loop instead of queue package
---
tam.el | 38 ++++++++++++--------------------------
1 file changed, 12 insertions(+), 26 deletions(-)
diff --git a/tam.el b/tam.el
index d7bdb4ef87..5051b69cb2 100644
--- a/tam.el
+++ b/tam.el
@@ -7,7 +7,7 @@
;; Maintainer: Onnie Lynn Winebarger <owinebar@gmail.com>
;; Version: 0.1
;; URL: https://github.com/owinebar/emacs-table-allocation-manager
-;; Package-Requires: ((queue "0.2") (emacs "24.3"))
+;; Package-Requires: ((emacs "24.4"))
;; Readme: Readme.md
;; This file is part of GNU Emacs.
@@ -57,8 +57,6 @@
(eval-when-compile
(require 'cl-lib))
-(require 'queue)
-
(cl-defstruct (tam--table (:constructor tam--table-create (size))
(:copier tam--copy-table))
"Table with explicitly managed allocation"
@@ -116,14 +114,8 @@
"Test if TBL is empty."
(= (tam--table-used tbl) 0))
-(defsubst tam-table-size (tbl)
- "Number of slots in TBL."
- (tam--table-size tbl))
-
-
-(defsubst tam-table-used (tbl)
- "Number of slots of TBL in use."
- (tam--table-used tbl))
+(defalias 'tam-table-size #'tam--table-size)
+(defalias 'tam-table-used #'tam--table-used)
(defun tam--table-get-slot (tbl idx)
"Get slot IDX of TBL."
@@ -136,7 +128,7 @@
(defun tam-allocate (tbl obj)
"Allocate slot in TBL with contents OBJ.
-Returns index or nil if table is full."
+Return index or nil if table is full."
(let ((s (tam--table-first-free tbl))
next idx)
(when (not (tam-table-fullp tbl))
@@ -159,8 +151,8 @@ Returns index or nil if table is full."
idx))
(defun tam-free (tbl idx)
- "Free slot at IDX in TBL. Return contents of slot IDX.
-Signals an error if IDX is not in use."
+ "Free slot at IDX in TBL.
+Return contents of slot IDX. Signals an error if IDX is not in use."
(let ((s (tam--table-get-slot tbl idx))
(last-free (tam--table-last-free tbl))
prev next obj)
@@ -195,21 +187,15 @@ Signals an error if IDX is not in use."
(defun tam-table-free-list (tbl)
"Return list of free indices in TBL."
- (let ((s (tam--table-first-free tbl))
- (q (queue-create)))
- (while s
- (queue-enqueue q (tam--slot-index s))
- (setq s (tam--slot-next s)))
- (queue-all q)))
+ (cl-loop for s = (tam--table-first-free tbl) then (tam--slot-next s)
+ while s
+ collect (tam--slot-index s)))
(defun tam-table-live-list (tbl)
"Return list of live indices in TBL."
- (let ((s (tam--table-first-used tbl))
- (q (queue-create)))
- (while s
- (queue-enqueue q (tam--slot-index s))
- (setq s (tam--slot-next s)))
- (queue-all q)))
+ (cl-loop for s = (tam--table-first-used tbl) then (tam--slot-next s)
+ while s
+ collect (tam--slot-index s)))
(provide 'tam)
- [elpa] externals/pam d2dd6a9796 05/16: Add functions to report free and live index lists, (continued)
- [elpa] externals/pam d2dd6a9796 05/16: Add functions to report free and live index lists, ELPA Syncer, 2023/09/20
- [elpa] externals/pam 7b072b5457 07/16: Added API documentation to header., ELPA Syncer, 2023/09/20
- [elpa] externals/pam 21cf632947 13/16: Added documentation strings to struct fields, ELPA Syncer, 2023/09/20
- [elpa] externals/pam bc654b6d68 14/16: Change data structures to primitive representation., ELPA Syncer, 2023/09/20
- [elpa] externals/pam 0dcaa2cc9c 16/16: Provide two versions for tam-release, one with and one without finalization., ELPA Syncer, 2023/09/20
- [elpa] externals/pam fe28ad02db 06/16: Fixed tam-allocate and tam-free functions., ELPA Syncer, 2023/09/20
- [elpa] externals/pam c74c0e06b5 12/16: Improve tam-create-pool docstring, ELPA Syncer, 2023/09/20
- [elpa] externals/pam acb2a6cbbb 11/16: Add object pool management, ELPA Syncer, 2023/09/20
- [elpa] externals/pam cbc1727fea 08/16: Fixed some issues with tam-table-used and tam-table-size., ELPA Syncer, 2023/09/20
- [elpa] externals/pam 15106c6acd 15/16: Define tam-already-free error symbol, ELPA Syncer, 2023/09/20
- [elpa] externals/pam 0f1f5cf265 10/16: Use cl-loop instead of queue package,
ELPA Syncer <=
- [elpa] externals/pam c254ec9f64 09/16: Renamed library and updated headers, ELPA Syncer, 2023/09/20