diff options
author | Eric Wong <e@80x24.org> | 2016-01-24 09:41:09 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-01-24 09:41:09 +0000 |
commit | fc8e446d5da1887044c86ed07e8cf2eee6cf2cfd (patch) | |
tree | 9b94f8503954b6534a77c30c6885257e6cb372a3 /lib/dtas/player/client_handler.rb | |
parent | 3a76adf065889787a300f5001126f3ca83731e27 (diff) | |
download | dtas-fc8e446d5da1887044c86ed07e8cf2eee6cf2cfd.tar.gz |
This reduces memory usage as a Regexp object is hundreds of bytes and a single-byte string object is only 40 bytes that is deduped within the VM.
Diffstat (limited to 'lib/dtas/player/client_handler.rb')
-rw-r--r-- | lib/dtas/player/client_handler.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dtas/player/client_handler.rb b/lib/dtas/player/client_handler.rb index 7ce9839..a6f5dba 100644 --- a/lib/dtas/player/client_handler.rb +++ b/lib/dtas/player/client_handler.rb @@ -422,7 +422,7 @@ module DTAS::Player::ClientHandler # :nodoc: def dpc_format(io, msg) new_fmt = @format.dup msg.each do |kv| - k, v = kv.split(/=/, 2) + k, v = kv.split('=', 2) case k when "type" new_fmt.valid_type?(v) or return io.emit("ERR invalid file type") @@ -497,7 +497,7 @@ module DTAS::Player::ClientHandler # :nodoc: before = src.to_state_hash.inspect sd = src.source_defaults msg.each do |kv| - k, v = kv.split(/=/, 2) + k, v = kv.split('=', 2) case k when "command" src.command = v.empty? ? sd[k] : v |