diff options
author | Eric Wong <e@80x24.org> | 2022-01-20 18:34:17 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2022-01-21 19:54:42 +0000 |
commit | 5111742a5a100e44fccf191b12a13c452b025944 (patch) | |
tree | 94c2e66a90425d80f937491e86cd3adfcc4eba84 /lib/dtas/partstats.rb | |
parent | c3b34b1693e7b35841d87dae0dce8ccecebe9008 (diff) | |
download | dtas-5111742a5a100e44fccf191b12a13c452b025944.tar.gz |
Ruby 2.3+ supports String#@-, though it did not deduplicate strings. But 2.5 is already old at this point and most users can be expected to have it. This gives some memory regressions for Ruby <= 2.4 users, but cuts down on the code we maintain and reduces bytecode overhead for 2.5+ users.
Diffstat (limited to 'lib/dtas/partstats.rb')
-rw-r--r-- | lib/dtas/partstats.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dtas/partstats.rb b/lib/dtas/partstats.rb index 8e9ee95..061ff50 100644 --- a/lib/dtas/partstats.rb +++ b/lib/dtas/partstats.rb @@ -171,7 +171,7 @@ becomes: else next end - key = DTAS.dedupe_str($1) + key = -$1 key_idx = @key_idx[key] parts = line.split(/\s+/) nshift.times { parts.shift } # remove stuff we don't need |