Project

General

Profile

Patch #38146 » 0008-Fix-RuboCop-offense-Performance-RedundantSplitRegexp.patch

Go MAEDA, 2023-01-04 07:28

View differences:

.rubocop_todo.yml
- '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:
lib/redmine/wiki_formatting/textile/redcloth3.rb
# 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|
......
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|
(9-9/9)