summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/num_data_source.rb
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-06-09 10:25:48 +0200
committerGeremia Taglialatela <[email protected]>2023-06-09 10:25:48 +0200
commit956d0b5e06580b6465a67159a9c0d1dd719f6442 (patch)
treeafcdf2020763faeb08aa302e2210c9702a80f45c /lib/axlsx/drawing/num_data_source.rb
parent2965ebd4c719ad34a75e70cb1640e94093c8c763 (diff)
downloadcaxlsx-956d0b5e06580b6465a67159a9c0d1dd719f6442.tar.gz
caxlsx-956d0b5e06580b6465a67159a9c0d1dd719f6442.zip
Refactor random char generation
Fix the following safe offenses: - Style/OperatorMethodCall - Style/RandomWithOffset And use Array.new to avoid an extra allocation: ``` Comparison (IPS): Array.new(8) { rand(65..89).chr }.join: 492433.7 i/s (0...8).map { 65.+(rand(25)).chr }.join: 432155.8 i/s - 1.14x (± 0.00) slower Comparison (Memory): Array.new(8) { rand(65..89).chr }.join: 440 allocated (0...8).map { 65.+(rand(25)).chr }.join: 560 allocated - 1.27x more ```
Diffstat (limited to 'lib/axlsx/drawing/num_data_source.rb')
0 files changed, 0 insertions, 0 deletions