Skip to content

Commit

Permalink
use empty? on the hash to avoid another method call
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Mar 16, 2012
1 parent 4c8a5a0 commit 090156a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/values/time_zone.rb
Expand Up @@ -266,7 +266,7 @@ def at(secs)
# Time.zone.parse('22:30:00') # => Fri, 31 Dec 1999 22:30:00 HST -10:00
def parse(str, now=now)
date_parts = Date._parse(str)
return if date_parts.blank?
return if date_parts.empty?
time = Time.parse(str, now) rescue DateTime.parse(str)
if date_parts[:offset].nil?
ActiveSupport::TimeWithZone.new(nil, self, time)
Expand Down

0 comments on commit 090156a

Please sign in to comment.