Re: small DateTime optimization
[email protected] (Dave Rolsky) Mon, 20 Mar 2017 02:25:55 -0500 (CDT)
| Newsgroups | perl.datetime |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 15 Mar 2017, Flavio S. Glock wrote: > We've been using this patch at work for years, and I just forgot to contribute it back. I hope you find it worth applying. > > I believe the typical use case was: > > my $dt = $param || DateTime->now(); > > In this case $param is used in boolean context, which makes a fallback call to _stringify(). With the patch, "boolean" just returns true. I committed this to master. In the future please feel free to just make a GitHub PR. Cheers, Dave Rolsky http://blog.urth.org https://github.com/autarch