Skip to content

Commit

Permalink
[Temporal] Don't clone the formatter, so .perl can always recognize t…
Browse files Browse the repository at this point in the history
…he default.
  • Loading branch information
Kodi Arfer authored and Kodi Arfer committed Oct 11, 2010
1 parent db221e3 commit e6aa633
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/Temporal.pm
Expand Up @@ -318,16 +318,16 @@ class DateTime does Dateish {
multi method clone(*%_) {
self.new(:$!year, :$!month, :$!day,
:$!hour, :$!minute, :$!second,
timezone => $!timezone.clone,
formatter => &!formatter.clone,
timezone => $!timezone,
formatter => &!formatter,
|%_)
}

multi method clone-without-validating(*%_) { # A premature optimization.
self.bless(*, :$!year, :$!month, :$!day,
:$!hour, :$!minute, :$!second,
timezone => $!timezone.clone,
formatter => &!formatter.clone,
timezone => $!timezone,
formatter => &!formatter,
|%_)
}

Expand Down Expand Up @@ -422,9 +422,9 @@ class DateTime does Dateish {

multi method perl() {
"DateTime.new(year => $.year, month => $.month, day => $.day, " ~
"hour => $.hour, minute => $.minute, second => $.second, " ~
"hour => $.hour, minute => $.minute, second => $.second.perl(), " ~
"timezone => $.timezone.perl()" ~
do $.formatter eqv &default-formatter
do &.formatter eqv &default-formatter
?? ')'
!! ", formatter => $.formatter.perl())"
}
Expand Down

0 comments on commit e6aa633

Please sign in to comment.