[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/9] player: remove omap conversion
From: |
Eric Wong |
Subject: |
[PATCH 2/9] player: remove omap conversion |
Date: |
Sun, 23 Jan 2022 21:37:39 +0000 |
"omap" is specific to Ruby and makes interopability with other
languages more difficult.
While it's true environment variables are stored as an ordered
array of C strings (see environ(7)); order doesn't matter in
practice. Everyone in the real world treats the environment as
an unordered key-value store.
Followup-to: cac63517e7f751cc (doc: drop ordered map from examples, 2022-01-07)
---
lib/dtas/player.rb | 7 -------
1 file changed, 7 deletions(-)
diff --git a/lib/dtas/player.rb b/lib/dtas/player.rb
index 243f0b0..3db15c3 100644
--- a/lib/dtas/player.rb
+++ b/lib/dtas/player.rb
@@ -1,7 +1,6 @@
# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
-require 'yaml'
require 'shellwords'
require_relative '../dtas'
require_relative 'xs'
@@ -123,10 +122,6 @@ def to_hsh
rv
end
- def to_omap(hash)
- YAML::Omap === hash ? hash : YAML::Omap.new.merge!(hash)
- end
-
def self.load(hash)
rv = new
rv.instance_eval do
@@ -157,7 +152,6 @@ def self.load(hash)
@source_map.each do |name, src|
src_hsh = v[name] or next
src.load!(src_hsh)
- src.env = to_omap(src.env)
end
source_map_reload
end
@@ -170,7 +164,6 @@ def self.load(hash)
sinks.each do |sink_hsh|
sink_hsh['name'] = -sink_hsh['name']
sink = DTAS::Sink.load(sink_hsh)
- sink.env = to_omap(sink.env)
@sinks[sink.name] = sink
end
end
- [PATCH 0/9] various cuts for memory savings, Eric Wong, 2022/01/23
- [PATCH 1/9] deduplicate and freeze pathnames + metadata, Eric Wong, 2022/01/23
- [PATCH 2/9] player: remove omap conversion,
Eric Wong <=
- [PATCH 3/9] dtas: drop unnecessary "require 'yaml'" statements, Eric Wong, 2022/01/23
- [PATCH 4/9] dtas-tl prune: cull missing files from tracklist, Eric Wong, 2022/01/23
- [PATCH 5/9] dtas-tl: drop encoding hacks, use binary stdout+stderr, Eric Wong, 2022/01/23
- [PATCH 6/9] use IO#wait_readable consistently, Eric Wong, 2022/01/23
- [PATCH 7/9] get rid of DTAS::Nonblock wrapper for Ruby <= 2.0, Eric Wong, 2022/01/23
- [PATCH 8/9] unix_accepted: drop Ruby < 2.3 support code, Eric Wong, 2022/01/23
- [PATCH 9/9] do not check IO#closed? before calling IO#close, Eric Wong, 2022/01/23