From f4c2ac4825f99ec4af529d65ae98abfaf034fb0f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 2 Mar 2017 04:08:23 +0000 Subject: deduplicate strings using String#-@ (uminus) in Ruby 2.5+ 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. --- lib/dtas/fadefx.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/dtas/fadefx.rb') diff --git a/lib/dtas/fadefx.rb b/lib/dtas/fadefx.rb index aca6c68..1a00653 100644 --- a/lib/dtas/fadefx.rb +++ b/lib/dtas/fadefx.rb @@ -95,7 +95,7 @@ class DTAS::FadeFX # :nodoc: def parse!(str) return nil if str.empty? type = "t" - str.sub!(/\A([a-z])/, "") and type = $1.freeze + str.sub!(/\A([a-z])/, "") and type = DTAS.dedupe_str($1) F.new(type, parse_time(str)) end end -- cgit v1.2.3-24-ge0c7