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:
Geoff Buesing
2008-03-17 05:14:26 +00:00
parent 2366fdbdb1
commit fe7c68ee5d
2 changed files with 3 additions and 7 deletions

View File

@@ -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]

View File

@@ -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