diff options
author | Andrew White <pixeltrix@users.noreply.github.com> | 2016-08-30 08:42:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-30 08:42:45 +0100 |
commit | 3132fa6b7d9585e04eb44b25b55d298391b040b5 (patch) | |
tree | 2336a22596e4a2e5097549b62a9e1626c00ec5f7 | |
parent | 6949f8e5e7dc901d4e04ebab6c975afb33ca44c9 (diff) | |
parent | af054a5ae9a60b1a3bc84f0db8b518315d5e172e (diff) | |
download | rails-3132fa6b7d9585e04eb44b25b55d298391b040b5.tar.gz rails-3132fa6b7d9585e04eb44b25b55d298391b040b5.tar.bz2 rails-3132fa6b7d9585e04eb44b25b55d298391b040b5.zip |
Merge pull request #25880 from ryandv/fix_performance_regression_in_timewithzone_to_time
Fix performance regression in `TimeWithZone#to_time`
-rw-r--r-- | activesupport/lib/active_support/time_with_zone.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index 9d1147620c..74c4a39342 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -80,7 +80,7 @@ module ActiveSupport # 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 |