diff --git a/.rubocop.yml b/.rubocop.yml index 94826b6b7e7..744b15aa866 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -658,9 +658,6 @@ Style/TrailingUnderscoreVariable: Lint/LiteralInInterpolation: Enabled: false -Performance/TimesMap: - Enabled: false - Layout/InitialIndentation: Enabled: false diff --git a/benchmarks/function_loading/benchmarker.rb b/benchmarks/function_loading/benchmarker.rb index 5c23342f110..98fb844bf6e 100644 --- a/benchmarks/function_loading/benchmarker.rb +++ b/benchmarks/function_loading/benchmarker.rb @@ -97,7 +97,7 @@ def generate def dependencies_for(n) return [] if n == 0 - n.times.map do |m| + Array.new(n) do |m| {'name' => "tester-module#{m}", 'version_requirement' => '1.0.0'} end end diff --git a/lib/puppet/pops/parser/heredoc_support.rb b/lib/puppet/pops/parser/heredoc_support.rb index 390e783f666..2982bb45132 100644 --- a/lib/puppet/pops/parser/heredoc_support.rb +++ b/lib/puppet/pops/parser/heredoc_support.rb @@ -136,7 +136,7 @@ def heredoc_text(lines, leading, has_margin, remove_break) # simply leaves lines that have text in the margin untouched. # processed_lines = lines.collect {|s| s.gsub(leading_pattern, '') } - margin_per_line = processed_lines.length.times.map {|x| lines[x].length - processed_lines[x].length } + margin_per_line = Array.new(processed_lines.length) {|x| lines[x].length - processed_lines[x].length } lines = processed_lines else # Array with a 0 per line