GNU bug report logs - #78162
[PATCH] hash-table-contains-p: Avoid creating a symbol on every call

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Wed, 30 Apr 2025 10:04:02 UTC

Severity: normal

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: 78162 <at> debbugs.gnu.org
Cc: mail <at> daniel-mendler.de, pipcet <at> protonmail.com, monnier <at> iro.umontreal.ca, stefankangas <at> gmail.com
Subject: bug#78162: [PATCH] hash-table-contains-p: Avoid creating a symbol on every call
Date: Sun, 11 May 2025 10:02:03 +0200
On Mai 11 2025, Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> diff --git a/lisp/subr.el b/lisp/subr.el
> index 79288921bed..962ae61cfd8 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -7436,11 +7436,11 @@
>    (declare (important-return-value t))
>    (string-trim-left (string-trim-right string trim-right) trim-left))
>  
> -(defsubst hash-table-contains-p (key table)
> +(let ((missing (make-symbol "missing")))
> +  (defsubst hash-table-contains-p (key table)
>    "Return non-nil if TABLE has an element with KEY."
>    (declare (side-effect-free t)
>             (important-return-value t))
> -  (let ((missing (make-symbol "missing")))

Or use '#:missing instead of (make-symbol "missing").

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




This bug report was last modified 12 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.