aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2016-08-30 08:42:45 +0100
committerGitHub <noreply@github.com>2016-08-30 08:42:45 +0100
commit3132fa6b7d9585e04eb44b25b55d298391b040b5 (patch)
tree2336a22596e4a2e5097549b62a9e1626c00ec5f7 /activesupport/lib/active_support
parent6949f8e5e7dc901d4e04ebab6c975afb33ca44c9 (diff)
parentaf054a5ae9a60b1a3bc84f0db8b518315d5e172e (diff)
downloadrails-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`
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb2
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