about summary refs log tree commit homepage
path: root/lib/dtas
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-01-25 09:56:53 +0000
committerEric Wong <e@80x24.org>2016-01-25 09:56:53 +0000
commit6c06185c7267567fe1237737342d3d8059d4bfc3 (patch)
treedc9eb65c51c4e69ce7211ed3b1d9426f1693a3c3 /lib/dtas
parent4c8f75cd3447e445e4a903bae0c022789c49b922 (diff)
downloaddtas-6c06185c7267567fe1237737342d3d8059d4bfc3.tar.gz
.each on a Sequel dataset is more appropriate for the way we
emit comments.

And using Array#map! is more efficient when we do not
need the original array.
Diffstat (limited to 'lib/dtas')
-rw-r--r--lib/dtas/mlib.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dtas/mlib.rb b/lib/dtas/mlib.rb
index ffd0cc3..09856ee 100644
--- a/lib/dtas/mlib.rb
+++ b/lib/dtas/mlib.rb
@@ -67,7 +67,7 @@ class DTAS::Mlib # :nodoc:
 
   def init_suffixes
     `sox --help 2>/dev/null` =~ /\nAUDIO FILE FORMATS:\s*([^\n]+)/s
-    re = $1.split(/\s+/).map { |x| Regexp.quote(x) }.join('|')
+    re = $1.split(/\s+/).map! { |x| Regexp.quote(x) }.join('|')
     @suffixes = Regexp.new("\\.(?:#{re}|yml)\\z", Regexp::IGNORECASE)
   end
 
@@ -428,7 +428,7 @@ class DTAS::Mlib # :nodoc:
     comments = Hash.new { |h,k| h[k] = [] }
     @db['SELECT c.tag_id, v.val FROM comments c ' \
         'LEFT JOIN vals v ON v.id = c.val_id ' \
-        "WHERE c.node_id = #{node[:id]} ORDER BY c.tag_id"].map do |c|
+        "WHERE c.node_id = #{node[:id]} ORDER BY c.tag_id"].each do |c|
       comments[@tag_rmap[c[:tag_id]]] << c[:val]
     end
     cb.call(parent, node, comments)