]> source.dussan.org Git - redmine.git/commitdiff
Fix RuboCop offense Performance/RedundantSplitRegexpArgument (#38146).
authorGo MAEDA <maeda@farend.jp>
Wed, 11 Jan 2023 13:33:32 +0000 (13:33 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 11 Jan 2023 13:33:32 +0000 (13:33 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@22033 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
lib/redmine/wiki_formatting/textile/redcloth3.rb

index b794a7124cf617aee3e822d55ea823d530e4fd13..9ff640eb4ba95c978ec0968ced1b82a41dbca80b 100644 (file)
@@ -486,11 +486,6 @@ Naming/VariableNumber:
     - 'test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb'
     - 'test/unit/project_test.rb'
 
-# This cop supports safe autocorrection (--autocorrect).
-Performance/RedundantSplitRegexpArgument:
-  Exclude:
-    - 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
-
 # This cop supports unsafe autocorrection (--autocorrect-all).
 # Configuration parameters: OnlySumOrWithInitialValue.
 Performance/Sum:
index 77bfa0ab6842cd6b1a084434786de9a3553f119e..406fca08dd25971e3e3de83db41e410b4c8c6cc5 100644 (file)
@@ -558,7 +558,7 @@ class RedCloth3 < String
     # Parses Textile lists and generates HTML
     def block_textile_lists( text )
         text.gsub!( LISTS_RE ) do |match|
-            lines = match.split( /\n/ )
+            lines = match.split( "\n" )
             last_line = -1
             depth = []
             lines.each_with_index do |line, line_id|
@@ -603,7 +603,7 @@ class RedCloth3 < String
 
     def block_textile_quotes( text )
       text.gsub!( QUOTES_RE ) do |match|
-        lines = match.split( /\n/ )
+        lines = match.split( "\n" )
         quotes = +''
         indent = 0
         lines.each do |line|