about summary refs log tree commit homepage
path: root/lib/dtas/player.rb
diff options
authorEric Wong <e@80x24.org>2016-12-31 03:46:27 +0000
committerEric Wong <e@80x24.org>2016-12-31 07:02:49 +0000
commit6a27326c4ac9459e194bd082cfec200578980517 (patch)
tree9276ffe3cec78955b796f58818c5d8ff5f5be55c /lib/dtas/player.rb
parent9152a00d3a706d93d7ed9705ce2529bd3d1f3772 (diff)
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.
Diffstat (limited to 'lib/dtas/player.rb')
1 files changed, 1 insertions, 0 deletions
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