From 1433a1201447f6f8b610f4d7f78a4b8a739c6572 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Tue, 5 Jan 2021 12:01:32 +0100 Subject: [PATCH] ruby-mode: eliminate redundant regexp branch * lisp/progmodes/ruby-mode.el (ruby-add-log-current-method): Since ruby-operator-re matches dot, don't include both in regexp. This pacifies relint. --- lisp/progmodes/ruby-mode.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index cd9d087856c..a8667acb9d5 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1603,9 +1603,9 @@ See `add-log-current-defun-function'." "\\(" ;; \\. and :: for class methods "\\([A-Za-z_]" ruby-symbol-re "*[?!]?" - (when method-name? "\\|") - (when method-name? ruby-operator-re) - "\\|\\.\\|::" "\\)" + "\\|" + (if method-name? ruby-operator-re "\\.") + "\\|::" "\\)" "+\\)"))) (definition-re (funcall make-definition-re ruby-defun-beg-re t)) (module-re (funcall make-definition-re "\\(class\\|module\\)"))) -- 2.39.2