summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-01-11 13:33:32 +0000
committerGo MAEDA <maeda@farend.jp>2023-01-11 13:33:32 +0000
commite010d90207d23fa47ae9d262433ac22436fa8b1a (patch)
tree193400b4e2a70536ea839544acf5edb0eee26303
parent62a930cc65472133123f674c4bbdfcbd822cc731 (diff)
downloadredmine-e010d90207d23fa47ae9d262433ac22436fa8b1a.tar.gz
redmine-e010d90207d23fa47ae9d262433ac22436fa8b1a.zip
Fix RuboCop offense Performance/RedundantSplitRegexpArgument (#38146).
git-svn-id: https://svn.redmine.org/redmine/trunk@22033 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--.rubocop_todo.yml5
-rw-r--r--lib/redmine/wiki_formatting/textile/redcloth3.rb4
2 files changed, 2 insertions, 7 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index b794a7124..9ff640eb4 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -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:
diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb
index 77bfa0ab6..406fca08d 100644
--- a/lib/redmine/wiki_formatting/textile/redcloth3.rb
+++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb
@@ -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|