mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
use empty? on the hash to avoid another method call
This commit is contained in:
parent
4c8a5a0087
commit
090156adeb
1 changed files with 1 additions and 1 deletions
|
@ -266,7 +266,7 @@ module ActiveSupport
|
||||||
# Time.zone.parse('22:30:00') # => Fri, 31 Dec 1999 22:30:00 HST -10:00
|
# Time.zone.parse('22:30:00') # => Fri, 31 Dec 1999 22:30:00 HST -10:00
|
||||||
def parse(str, now=now)
|
def parse(str, now=now)
|
||||||
date_parts = Date._parse(str)
|
date_parts = Date._parse(str)
|
||||||
return if date_parts.blank?
|
return if date_parts.empty?
|
||||||
time = Time.parse(str, now) rescue DateTime.parse(str)
|
time = Time.parse(str, now) rescue DateTime.parse(str)
|
||||||
if date_parts[:offset].nil?
|
if date_parts[:offset].nil?
|
||||||
ActiveSupport::TimeWithZone.new(nil, self, time)
|
ActiveSupport::TimeWithZone.new(nil, self, time)
|
||||||
|
|
Loading…
Reference in a new issue