branch: elpa/magit
commit ef0c6dfa3389a4d9b45664345fc6ee614faeef75
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    Use cl-pushnew instead of add-to-list where appropriate
---
 lisp/magit-diff.el | 4 ++--
 lisp/magit-mode.el | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 6bb06b18168..a5903254e74 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -3258,7 +3258,7 @@ are highlighted."
       (setq highlight nil))
     (cond (highlight
            (unless (oref section hidden)
-             (add-to-list 'magit-section-highlighted-sections section)
+             (cl-pushnew section magit-section-highlighted-sections)
              (cond ((memq section magit-section-unhighlight-sections)
                     (setq magit-section-unhighlight-sections
                           (delq section magit-section-unhighlight-sections)))
@@ -3267,7 +3267,7 @@ are highlighted."
           (t
            (cond ((and (oref section hidden)
                        (memq section magit-section-unhighlight-sections))
-                  (add-to-list 'magit-section-highlighted-sections section)
+                  (cl-pushnew section magit-section-highlighted-sections)
                   (setq magit-section-unhighlight-sections
                         (delq section magit-section-unhighlight-sections)))
                  (t
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index e1b47a00e96..8dc4cf4f037 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -878,7 +878,7 @@ If a frame, then only consider buffers on that frame."
       (setq magit-buffer-locked-p (and value t))
       (magit-restore-section-visibility-cache mode))
     (when magit-uniquify-buffer-names
-      (add-to-list 'uniquify-list-buffers-directory-modes mode)
+      (cl-pushnew mode uniquify-list-buffers-directory-modes)
       (with-current-buffer buffer
         (setq list-buffers-directory (abbreviate-file-name default-directory)))
       (let ((uniquify-buffer-name-style
@@ -1135,7 +1135,7 @@ should obviously not add this function to that hook."
   (when-let (((and (not magit--disable-save-buffers)
                    (magit-inside-worktree-p t)))
              (buf (ignore-errors (magit-get-mode-buffer 'magit-status-mode))))
-    (add-to-list 'magit-after-save-refresh-buffers buf)
+    (cl-pushnew buf magit-after-save-refresh-buffers)
     (add-hook 'post-command-hook #'magit-after-save-refresh-buffers)))
 
 (defun magit-maybe-save-repository-buffers ()

Reply via email to