Skip to content
Permalink
Browse files

Make creation of DateTime a bit faster

Before, that used to be the best way.  Apparently not so anymore.  Makes
.later about 5% faster.
  • Loading branch information...
lizmat committed Nov 11, 2018
1 parent 11cb4fa commit b6292fe9caa201f556b282438dc3e06c85e7e16e
Showing with 10 additions and 9 deletions.
  1. +10 −9 src/core/DateTime.pm6
@@ -46,15 +46,16 @@ my class DateTime does Dateish {
!! X::DateTime::InvalidDeltaUnit.new(:$unit).throw
}

method !SET-SELF(\y,\mo,\d,\h,\mi,\s,\t,\f) {
$!year = y;
$!month = mo;
$!day = d;
$!hour = h;
$!minute = mi;
$!second = s;
$!timezone = t;
&!formatter = f;
method !SET-SELF(
$!year,
$!month,
$!day,
$!hour,
$!minute,
$!second,
$!timezone,
&!formatter,
) {
self
}
method !new-from-positional(DateTime:

0 comments on commit b6292fe

Please sign in to comment.
You can’t perform that action at this time.