From fc8e446d5da1887044c86ed07e8cf2eee6cf2cfd Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 24 Jan 2016 09:41:09 +0000 Subject: String#split with a single-byte instead of regexp 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. --- lib/dtas/format.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/dtas/format.rb') diff --git a/lib/dtas/format.rb b/lib/dtas/format.rb index 001a444..f378f8e 100644 --- a/lib/dtas/format.rb +++ b/lib/dtas/format.rb @@ -164,7 +164,7 @@ class DTAS::Format # :nodoc: end # deal with HH:MM:SS - t = time.split(/:/) + t = time.split(':') raise ArgumentError, "Bad time format: #{hhmmss}" if t.size > 3 mult = 1 -- cgit v1.2.3-24-ge0c7