From: Stefan Kangas Date: Sat, 29 Mar 2025 11:34:37 +0000 (+0100) Subject: Remove redundant constant nil argument to gethash X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a5a91aba96b3bf70cb3b03feb9117dc3daa5b54e;p=emacs.git Remove redundant constant nil argument to gethash * lisp/cedet/ede/files.el (ede--directory-project-from-hash): * lisp/emacs-lisp/edebug.el (edebug-unwrap*): * lisp/emacs-lisp/testcover.el (testcover--copy-object1): * lisp/net/zeroconf.el (zeroconf-get-service, zeroconf-resolve-service) (zeroconf-register-service-browser, zeroconf-service-browser-handler) (zeroconf-register-service-resolver): * lisp/url/url-history.el (url-have-visited-url): Remove redundant constant nil argument to gethash. (cherry picked from commit 14cf4d538350fd2b1eda35101f5bb585f55e4659) --- diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index aea7b459736..25152c50f8f 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -1288,7 +1288,7 @@ infinite loops when the code/environment contains a circular object.") (while (not (eq sexp (setq sexp (edebug-unwrap sexp))))) (cond ((consp sexp) - (or (gethash sexp edebug--unwrap-cache nil) + (or (gethash sexp edebug--unwrap-cache) (let ((remainder sexp) (current (cons nil nil))) (prog1 current @@ -1303,8 +1303,8 @@ infinite loops when the code/environment contains a circular object.") (setf (cdr current) (edebug-unwrap* remainder)) nil) - ((gethash remainder edebug--unwrap-cache nil) - (setf (cdr current) (gethash remainder edebug--unwrap-cache nil)) + ((gethash remainder edebug--unwrap-cache) + (setf (cdr current) (gethash remainder edebug--unwrap-cache)) nil) (t (setq current (setf (cdr current) (cons nil nil))))))))))) diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el index b007e3c9091..eb78768f0e6 100644 --- a/lisp/emacs-lisp/testcover.el +++ b/lisp/emacs-lisp/testcover.el @@ -296,7 +296,7 @@ iteratively copies its cdr. When VECP is non-nil, copy vectors as well as conses." (if (and (atom obj) (or (not vecp) (not (vectorp obj)))) obj - (let ((copy (gethash obj hash-table nil))) + (let ((copy (gethash obj hash-table))) (unless copy (cond ((consp obj) @@ -315,7 +315,7 @@ vectors as well as conses." (testcover--copy-object1 rest vecp hash-table)) nil) ((gethash rest hash-table nil) - (setf (cdr current) (gethash rest hash-table nil)) + (setf (cdr current) (gethash rest hash-table)) nil) (t (setq current (setf (cdr current) (cons nil nil))))))))) diff --git a/lisp/net/zeroconf.el b/lisp/net/zeroconf.el index 73ace17a920..311b1a73e77 100644 --- a/lisp/net/zeroconf.el +++ b/lisp/net/zeroconf.el @@ -380,7 +380,7 @@ TYPE. The resulting list has the format (INTERFACE PROTOCOL NAME TYPE DOMAIN FLAGS)." ;; Due to the service browser, all known services are kept in ;; `zeroconf-services-hash'. - (gethash (concat name "/" type) zeroconf-services-hash nil)) + (gethash (concat name "/" type) zeroconf-services-hash)) (defvar dbus-debug) @@ -396,7 +396,7 @@ TYPE. The resulting list has the format (or ;; Check whether we know this service already. - (gethash key zeroconf-resolved-services-hash nil) + (gethash key zeroconf-resolved-services-hash) ;; Resolve the service. We don't propagate D-Bus errors. (dbus-ignore-errors @@ -541,7 +541,7 @@ DOMAIN is nil, the local domain is used." (defun zeroconf-register-service-browser (type) "Register a service browser at the Avahi daemon." - (or (gethash type zeroconf-path-avahi-service-browser-hash nil) + (or (gethash type zeroconf-path-avahi-service-browser-hash) (puthash type (dbus-call-method :system zeroconf-service-avahi zeroconf-path-avahi @@ -562,8 +562,8 @@ DOMAIN is nil, the local domain is used." (let* ((name (zeroconf-service-name val)) (type (zeroconf-service-type val)) (key (concat name "/" type)) - (ahook (gethash type zeroconf-service-added-hooks-hash nil)) - (rhook (gethash type zeroconf-service-removed-hooks-hash nil))) + (ahook (gethash type zeroconf-service-added-hooks-hash)) + (rhook (gethash type zeroconf-service-removed-hooks-hash))) (cond ((string-equal (dbus-event-member-name last-input-event) "ItemNew") ;; Add new service. @@ -579,7 +579,7 @@ DOMAIN is nil, the local domain is used." (defun zeroconf-register-service-resolver (name type) "Register a service resolver at the Avahi daemon." (let ((key (concat name "/" type))) - (or (gethash key zeroconf-path-avahi-service-resolver-hash nil) + (or (gethash key zeroconf-path-avahi-service-resolver-hash) (puthash key (dbus-call-method :system zeroconf-service-avahi zeroconf-path-avahi diff --git a/lisp/url/url-history.el b/lisp/url/url-history.el index d0506295f9c..825e259d330 100644 --- a/lisp/url/url-history.el +++ b/lisp/url/url-history.el @@ -154,7 +154,7 @@ user for what type to save as." (defun url-have-visited-url (url) (url-do-setup) - (gethash url url-history-hash-table nil)) + (gethash url url-history-hash-table)) (defun url-completion-function (string predicate function) (declare (obsolete url-history-hash-table "26.1"))