John Siracusa schreef:
> Okay, here's a simple implementation of a memoized 
> DateTime::Locale::load().

A solution that is more or less equivalent, is to change the
DefaultLocale routine. At the moment, $DefaultLocale is saved as a
string; every time DT::new() is called without a "locale" argument, the
default locale is loaded again.

It should be a bit faster than your version, because DT::Locale::load is
never called in DT::new(). (Except if you specify another locale; in
that case you should pass the locale object, not the locale name, if you
want speed.)

Probably this changes the behaviour if the default locale is aliased.
But IMHO, that's probably for the better.

Probably this should happen with the timezone parameter as well: change

    default => 'floating'

to

    default => DateTime::TimeZone->new( name => 'floating' )

Eugene

Reply via email to