Merge pull request #25880 from ryandv/fix_performance_regression_in_timewithzone_to_time

Fix performance regression in `TimeWithZone#to_time`
This commit is contained in:
Andrew White 2016-08-30 08:42:45 +01:00 committed by GitHub
commit 3132fa6b7d

@ -80,7 +80,7 @@ def in_time_zone(new_zone = ::Time.zone)
# Returns a <tt>Time</tt> instance of the simultaneous time in the system timezone.
def localtime(utc_offset = nil)
utc.getlocal(utc_offset)
@localtime ||= utc.getlocal(utc_offset)
end
alias_method :getlocal, :localtime