summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/worksheet
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-06-05 15:53:15 +0200
committerGeremia Taglialatela <[email protected]>2023-06-05 17:27:41 +0200
commit7fdbd745a2c914001a2174aeadae26b9c970ffaf (patch)
tree9b1a440ef0bee0ecaaeb7c991dcc9d8639cb7b6d /lib/axlsx/workbook/worksheet
parenta2eeaeefca8deb3d26f3f8dc62976fe6bf1dafcf (diff)
downloadcaxlsx-7fdbd745a2c914001a2174aeadae26b9c970ffaf.tar.gz
caxlsx-7fdbd745a2c914001a2174aeadae26b9c970ffaf.zip
Fix Style/FormatString offenses
`Kernel#format` is faster and will avoid to allocate an array compared to `String#%`. ``` IPS: kernel_format: 3877614.2 i/s string_percent: 3531475.0 i/s - 1.10x (± 0.00) slower Memory: kernel_format: 160 allocated string_percent: 200 allocated - 1.25x more ```
Diffstat (limited to 'lib/axlsx/workbook/worksheet')
-rw-r--r--lib/axlsx/workbook/worksheet/worksheet.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb
index 29a22db1..07221b3f 100644
--- a/lib/axlsx/workbook/worksheet/worksheet.rb
+++ b/lib/axlsx/workbook/worksheet/worksheet.rb
@@ -675,9 +675,9 @@ module Axlsx
if parts.size > 2
raise ArgumentError, (ERR_CELL_REFERENCE_INVALID % cell_def)
elsif parts.first.nil?
- raise ArgumentError, (ERR_CELL_REFERENCE_MISSING_CELL % [cell_def.split(":").first, cell_def])
+ raise ArgumentError, format(ERR_CELL_REFERENCE_MISSING_CELL, cell_def.split(":").first, cell_def)
elsif parts.last.nil?
- raise ArgumentError, (ERR_CELL_REFERENCE_MISSING_CELL % [cell_def.split(":").last, cell_def])
+ raise ArgumentError, format(ERR_CELL_REFERENCE_MISSING_CELL, cell_def.split(":").last, cell_def)
end
range(*parts)