]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove redundant constant nil argument to gethash
authorStefan Kangas <stefankangas@gmail.com>
Sat, 29 Mar 2025 11:34:37 +0000 (12:34 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 31 Mar 2025 08:35:51 +0000 (10:35 +0200)
* 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)

lisp/emacs-lisp/edebug.el
lisp/emacs-lisp/testcover.el
lisp/net/zeroconf.el
lisp/url/url-history.el

index aea7b45973694f9a7c6c181860a4c5a339d3706a..25152c50f8fbb1e98e8aa35665eab0b0fd7df485 100644 (file)
@@ -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)))))))))))
index b007e3c90913de077f3935452fb7a7da7bf543e9..eb78768f0e698b2f3f6258f80360b6a9b152685b 100644 (file)
@@ -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)))))))))
index 73ace17a920b337d4a191aceaf22599378c2020c..311b1a73e778cec5af40e6f9e91a0cc31b73cb0c 100644 (file)
@@ -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
index d0506295f9c12bce1856d7f2b901d11cf469ed61..825e259d330a75c13615a1681ad8cc8015aabda1 100644 (file)
@@ -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"))