emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/xelb b008b97d01 2/2: Use the builtin `logcount` functio


From: ELPA Syncer
Subject: [elpa] externals/xelb b008b97d01 2/2: Use the builtin `logcount` function (#17)
Date: Fri, 19 Jan 2024 12:59:03 -0500 (EST)

branch: externals/xelb
commit b008b97d01041378b43389881753b8df10571fa3
Author: Steven Allen <steven@stebalien.com>
Commit: GitHub <noreply@github.com>

    Use the builtin `logcount` function (#17)
    
    * xcb-types.el (xcb:-popcount): Use the builtin logcount function, new
      as of Emacs 27.
---
 xcb-types.el | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/xcb-types.el b/xcb-types.el
index 8bd3a29934..d0bd82363f 100644
--- a/xcb-types.el
+++ b/xcb-types.el
@@ -415,10 +415,7 @@ FORMAT-STRING is a string specifying the message to 
output, as in
 
 (defsubst xcb:-popcount (mask)
   "Return the popcount of integer MASK."
-  (apply #'+ (mapcar (lambda (i)
-                       (logand (lsh mask i) 1))
-                     ;; 32-bit number assumed (CARD32)
-                     (eval-when-compile (number-sequence -31 0)))))
+  (logcount mask))
 
 (defsubst xcb:-request-class->reply-class (request)
   "Return the reply class corresponding to the request class REQUEST."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]