about summary refs log tree commit homepage
path: root/lib/dtas/partstats.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-01-24 09:41:09 +0000
committerEric Wong <e@80x24.org>2016-01-24 09:41:09 +0000
commitfc8e446d5da1887044c86ed07e8cf2eee6cf2cfd (patch)
tree9b94f8503954b6534a77c30c6885257e6cb372a3 /lib/dtas/partstats.rb
parent3a76adf065889787a300f5001126f3ca83731e27 (diff)
downloaddtas-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/partstats.rb')
-rw-r--r--lib/dtas/partstats.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dtas/partstats.rb b/lib/dtas/partstats.rb
index cd37e0a..9714ebe 100644
--- a/lib/dtas/partstats.rb
+++ b/lib/dtas/partstats.rb
@@ -160,7 +160,7 @@ becomes:
 
   def parse_stats(stats, trim_part, buf)
     trim_row = [ trim_part ]
-    buf.split(/\n/).each do |line|
+    buf.split("\n").each do |line|
       do_map = true
       case line
       when /\A(\S+ \S+ dB)\s/, /\A(Crest factor)\s+-\s/