]> gitweb.factorcode.org Git - factor.git/commitdiff
calendar: durations don't need to clone instants.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 17 Jul 2012 00:37:32 +0000 (17:37 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 17 Jul 2012 00:37:32 +0000 (17:37 -0700)
basis/calendar/calendar.factor

index 7a309c306afe1f317918abddeb286df2343fc1c9..802e3ae10ef7ffc9cb3c54b17cc4e46c27c26f68 100644 (file)
@@ -155,13 +155,13 @@ M: timestamp easter ( timestamp -- timestamp )
 : >time< ( timestamp -- hour minute second )
     [ hour>> ] [ minute>> ] [ second>> ] tri ;
 
-: years ( x -- duration ) instant clone swap >>year ;
-: months ( x -- duration ) instant clone swap >>month ;
-: days ( x -- duration ) instant clone swap >>day ;
+: years ( x -- duration ) instant swap >>year ;
+: months ( x -- duration ) instant swap >>month ;
+: days ( x -- duration ) instant swap >>day ;
 : weeks ( x -- duration ) 7 * days ;
-: hours ( x -- duration ) instant clone swap >>hour ;
-: minutes ( x -- duration ) instant clone swap >>minute ;
-: seconds ( x -- duration ) instant clone swap >>second ;
+: hours ( x -- duration ) instant swap >>hour ;
+: minutes ( x -- duration ) instant swap >>minute ;
+: seconds ( x -- duration ) instant swap >>second ;
 : milliseconds ( x -- duration ) 1000 / seconds ;
 : microseconds ( x -- duration ) 1000000 / seconds ;
 : nanoseconds ( x -- duration ) 1000000000 / seconds ;