From 6a27326c4ac9459e194bd082cfec200578980517 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 31 Dec 2016 03:46:27 +0000 Subject: player: freeze sink name to avoid needless dup Ruby Hashes will automatically create frozen copies of unfrozen strings used as hash keys to avoid accidental mutation. Pre-freeze keys explicitly so the Ruby VM will not need to create the frozen copy. --- lib/dtas/player.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/dtas/player.rb') diff --git a/lib/dtas/player.rb b/lib/dtas/player.rb index 0711885..45a1da8 100644 --- a/lib/dtas/player.rb +++ b/lib/dtas/player.rb @@ -168,6 +168,7 @@ class DTAS::Player # :nodoc: if sinks = hash["sinks"] sinks.each do |sink_hsh| + sink_hsh['name'].freeze sink = DTAS::Sink.load(sink_hsh) sink.env = to_omap(sink.env) @sinks[sink.name] = sink -- cgit v1.2.3-24-ge0c7