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:
parent
2366fdbdb1
commit
fe7c68ee5d
@ -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 @@ def period_for_local(time, dst=true)
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user