From 00c5ef06e783f232be80ee76bc9c5d38285b527f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 13 Dec 2015 23:17:37 +0000 Subject: parse_time: enable frozen_string_literal 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. --- lib/dtas/parse_time.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 # 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 -- cgit v1.2.3-24-ge0c7