From 90c070fec6ee9b1832adfef54f1b87d480478bdc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerd=20M=C3=B6llmann?= Date: Wed, 19 Oct 2022 16:15:08 +0200 Subject: [PATCH] Restore obarray.el to return vectors --- lisp/obarray.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/obarray.el b/lisp/obarray.el index e335c66d51f..604314d3574 100644 --- a/lisp/obarray.el +++ b/lisp/obarray.el @@ -32,16 +32,19 @@ (defun obarray-make (&optional size) "Return a new obarray of size SIZE or `obarray-default-size'." - (make-%package "obarray" (or size 31))) + (let ((size (or size obarray-default-size))) + (if (< 0 size) + (make-vector size 0) + (signal 'wrong-type-argument '(size 0))))) -(defun obarray-size (_ob) +(defun obarray-size (ob) "Return the number of slots of obarray OB." - obarray-default-size) + (length ob)) (defun obarrayp (object) "Return t if OBJECT is an obarray." - (or (packagep object) - (vectorp object))) + (and (vectorp object) + (< 0 (length object)))) ;; Don’t use obarray as a variable name to avoid shadowing. (defun obarray-get (ob name) -- 2.39.2