aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/values
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2008-03-17 05:14:26 +0000
committerGeoff Buesing <gbuesing@gmail.com>2008-03-17 05:14:26 +0000
commitfe7c68ee5d4d78b705bc91c0652b05202b3eb30e (patch)
tree814e126a4cea6bfb98b84e215d3b6a44d241fc6d /activesupport/lib/active_support/values
parent2366fdbdb1e8a5ba4ee07d94e79c2011f5821820 (diff)
downloadrails-fe7c68ee5d4d78b705bc91c0652b05202b3eb30e.tar.gz
rails-fe7c68ee5d4d78b705bc91c0652b05202b3eb30e.tar.bz2
rails-fe7c68ee5d4d78b705bc91c0652b05202b3eb30e.zip
TZInfo caches Timezone instances in its own internal hash cache, so TimeZone::MAPPING doesn't need to cache them as well
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9046 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/values')
-rw-r--r--activesupport/lib/active_support/values/time_zone.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb
index 1d33dcbf32..085fab9731 100644
--- a/activesupport/lib/active_support/values/time_zone.rb
+++ b/activesupport/lib/active_support/values/time_zone.rb
@@ -247,13 +247,7 @@ class TimeZone
end
def tzinfo
- return @tzinfo if @tzinfo
- @tzinfo = MAPPING[name]
- if String === @tzinfo
- @tzinfo = TZInfo::Timezone.get(@tzinfo)
- MAPPING[name] = @tzinfo
- end
- @tzinfo
+ @tzinfo ||= TZInfo::Timezone.get(MAPPING[name])
end
rescue LoadError # Tzinfo gem is not available