From 9e5bc61c60f8775150163d6d2da73d60083f0dbd Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Thu, 15 Jun 2023 09:20:31 +0200 Subject: Fix Lint/UnusedBlockArgument offenses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use `each_value` instead of `each` where possible. The performance gain is minimal (3%). ``` Comparison: each_value: 4105733.4 i/s each: 3998011.4 i/s - 1.03x (± 0.00) slower ``` --- lib/axlsx/drawing/axes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/axlsx/drawing/axes.rb') diff --git a/lib/axlsx/drawing/axes.rb b/lib/axlsx/drawing/axes.rb index 010fe8cd..f63ef95d 100644 --- a/lib/axlsx/drawing/axes.rb +++ b/lib/axlsx/drawing/axes.rb @@ -32,7 +32,7 @@ module Axlsx def to_xml_string(str = +'', options = {}) if options[:ids] # CatAxis must come first in the XML (for Microsoft Excel at least) - sorted = axes.sort_by { |name, axis| axis.is_a?(CatAxis) ? 0 : 1 } + sorted = axes.sort_by { |_name, axis| axis.is_a?(CatAxis) ? 0 : 1 } sorted.each { |axis| str << '' } else axes.each { |axis| axis[1].to_xml_string(str) } -- cgit v1.2.3