mirror of
https://github.com/github/rails.git
synced 2026-01-30 00:38:00 -05:00
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
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* TZInfo caches Timezone instances in its own internal hash cache, so TimeZone::MAPPING doesn't need to cache them as well [Geoff Buesing]
|
||||
|
||||
* Adding TimeZone#parse [Geoff Buesing]
|
||||
|
||||
* Adding TimeZone#at and DateTime#to_f [Geoff Buesing]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user