diff options
author | Eric Wong <e@80x24.org> | 2015-12-13 23:17:37 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-12-13 23:38:20 +0000 |
commit | 00c5ef06e783f232be80ee76bc9c5d38285b527f (patch) | |
tree | 008cf1dd49ee38edc675f3199cf940e981a09616 | |
parent | f2549e5fc7f504ecd684e43a3c73522a660dbed5 (diff) | |
download | dtas-00c5ef06e783f232be80ee76bc9c5d38285b527f.tar.gz |
This is a new feature in Ruby 2.3 which can reduce allocations without adding ugly ".freeze" calls everywhere. This is a small enough file that we shouldn't have to worry about inadvertant breakage.
-rw-r--r-- | lib/dtas/parse_time.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/dtas/parse_time.rb b/lib/dtas/parse_time.rb index 473f412..454c067 100644 --- a/lib/dtas/parse_time.rb +++ b/lib/dtas/parse_time.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org> # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) require_relative '../dtas' @@ -17,7 +18,7 @@ module DTAS::ParseTime rv = hhmmss.sub!(/\.(\d+)\z/, "") ? "0.#$1".to_f : 0 # deal with HH:MM:SS - t = hhmmss.split(/:/) + t = hhmmss.split(':') raise ArgumentError, "Bad time format: #{hhmmss}" if t.size > 3 mult = 1 |