about summary refs log tree commit homepage
path: root/lib/dtas/partstats.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-03-02 04:08:23 +0000
committerEric Wong <e@80x24.org>2017-03-02 04:08:43 +0000
commitf4c2ac4825f99ec4af529d65ae98abfaf034fb0f (patch)
treebbae58219dc4d158c033b892e0a7da67a969ecdc /lib/dtas/partstats.rb
parentc2e04a5715d4cfa2b42fa09ba1f641d3ce741685 (diff)
downloaddtas-f4c2ac4825f99ec4af529d65ae98abfaf034fb0f.tar.gz
This is faster than relying on eval() for older Rubies.
https://bugs.ruby-lang.org/issues/13077
Ruby 2.5 is targetted for release in December 2017.
Diffstat (limited to 'lib/dtas/partstats.rb')
-rw-r--r--lib/dtas/partstats.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/dtas/partstats.rb b/lib/dtas/partstats.rb
index f9f2116..1037c87 100644
--- a/lib/dtas/partstats.rb
+++ b/lib/dtas/partstats.rb
@@ -173,8 +173,7 @@ becomes:
       else
         next
       end
-      key = $1
-      key.freeze
+      key = DTAS.dedupe_str($1)
       key_idx = @key_idx[key]
       parts = line.split(/\s+/)
       nshift.times { parts.shift } # remove stuff we don't need