diff options
| author | Mattias EngdegÄrd <mattiase@acm.org> | 2020-02-01 18:07:32 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd <mattiase@acm.org> | 2020-02-01 22:27:23 +0100 |
| commit | 32763dac46e61cc34e8fe4d19df4905d09c1a27f (patch) | |
| tree | e7f831860af5d3a412dc3dcfbdb958fa23cbd5b3 /lisp/net/zeroconf.el | |
| parent | d07f177382b24945e1f579744702908b33605c3e (diff) | |
| download | emacs-32763dac46e61cc34e8fe4d19df4905d09c1a27f.tar.gz | |
Replace add-to-list to lexical variable with push (bug#39373)
Since 'add-to-list', being a plain function, cannot access lexical
variables, such use must be rewritten for correctness.
(Some instances actually do work thanks to a compiler macro,
but it's not something code should rely on.)
* lisp/autoinsert.el (auto-insert-alist):
* lisp/cedet/mode-local.el (mode-local-print-bindings):
* lisp/net/tramp-cache.el (tramp-flush-connection-properties)
(tramp-list-connections):
* lisp/net/zeroconf.el (zeroconf-list-service-names)
(zeroconf-list-service-types, zeroconf-list-services):
* lisp/org/org.el (org-reload):
* lisp/whitespace.el (whitespace-report-region):
* test/lisp/emacs-lisp/map-tests.el (test-map-do):
Replace add-to-list with push.
Diffstat (limited to 'lisp/net/zeroconf.el')
| -rw-r--r-- | lisp/net/zeroconf.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/net/zeroconf.el b/lisp/net/zeroconf.el index b8becd712f5..cb3c0f2a7ee 100644 --- a/lisp/net/zeroconf.el +++ b/lisp/net/zeroconf.el @@ -256,17 +256,17 @@ supported keys depend on the service type.") "Return all discovered Avahi service names as list." (let (result) (maphash - (lambda (_key value) (add-to-list 'result (zeroconf-service-name value))) + (lambda (_key value) (push (zeroconf-service-name value) result)) zeroconf-services-hash) - result)) + (delete-dups result))) (defun zeroconf-list-service-types () "Return all discovered Avahi service types as list." (let (result) (maphash - (lambda (_key value) (add-to-list 'result (zeroconf-service-type value))) + (lambda (_key value) (push (zeroconf-service-type value) result)) zeroconf-services-hash) - result)) + (delete-dups result))) (defun zeroconf-list-services (type) "Return all discovered Avahi services for a given service type TYPE. @@ -278,9 +278,9 @@ format of SERVICE." (maphash (lambda (_key value) (when (equal type (zeroconf-service-type value)) - (add-to-list 'result value))) + (push value result))) zeroconf-services-hash) - result)) + (delete-dups result))) (defvar zeroconf-service-added-hooks-hash (make-hash-table :test 'equal) "Hash table of hooks for newly added services. |
