diff options
author | Dmitry Gutov <dgutov@yandex.ru> | 2023-04-13 00:45:54 +0300 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2023-04-13 00:46:11 +0300 |
commit | a22eb9ae0f9bfb745d05ea5b069b59592f19f1eb (patch) | |
tree | fadadc41f3ce775f5d957eab59038ad2684cd5c2 /lisp | |
parent | 17d803d0a7545db360c917e576aa77cea10a9b29 (diff) | |
download | emacs-a22eb9ae0f9bfb745d05ea5b069b59592f19f1eb.tar.gz |
ruby-add-log-current-method: Reduce the use of 'nreverse'
* lisp/progmodes/ruby-mode.el (ruby-add-log-current-method):
Reduce the use of 'nreverse' (bug#62761).
* test/lisp/progmodes/ruby-mode-tests.el
(ruby-add-log-current-method-singleton-referencing-outer):
New test.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/progmodes/ruby-mode.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index beccb8182a7..b252826680c 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1905,13 +1905,13 @@ See `add-log-current-defun-function'." (progn (unless (string-equal "self" (car mn)) ; def self.foo ;; def C.foo - (let ((ml (nreverse mlist))) + (let ((ml (reverse mlist))) ;; If the method name references one of the ;; containing modules, drop the more nested ones. (while ml (if (string-equal (car ml) (car mn)) (setq mlist (nreverse (cdr ml)) ml nil)) - (or (setq ml (cdr ml)) (nreverse mlist)))) + (setq ml (cdr ml)))) (if mlist (setcdr (last mlist) (butlast mn)) (setq mlist (butlast mn)))) |