Skip to content

Commit

Permalink
review feedback + rebase main
Browse files Browse the repository at this point in the history
  • Loading branch information
fwbrasil committed Oct 17, 2024
1 parent 5955e5c commit 9660dca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions kyo-data/shared/src/main/scala/kyo/Instant.scala
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ object Instant:
* @return
* The earlier of the two Instants.
*/
def min(other: Instant): Instant = if instant.isBefore(other) then instant else other
infix def min(other: Instant): Instant = if instant.isBefore(other) then instant else other

/** Returns the maximum of this Instant and another.
*
Expand All @@ -154,7 +154,7 @@ object Instant:
* @return
* The later of the two Instants.
*/
def max(other: Instant): Instant = if instant.isAfter(other) then instant else other
infix def max(other: Instant): Instant = if instant.isAfter(other) then instant else other

/** Converts this Instant to a human-readable ISO-8601 formatted string.
*
Expand Down
12 changes: 6 additions & 6 deletions kyo-data/shared/src/main/scala/kyo/Schedule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sealed abstract class Schedule derives CanEqual:
* @return
* a new schedule that produces the maximum delay of both schedules
*/
final def max(that: Schedule): Schedule =
final infix def max(that: Schedule): Schedule =
this match
case Never => this
case Done | Immediate => that
Expand All @@ -42,7 +42,7 @@ sealed abstract class Schedule derives CanEqual:
* @return
* a new schedule that produces the minimum delay of both schedules
*/
final def min(that: Schedule): Schedule =
final infix def min(that: Schedule): Schedule =
this match
case Never => that
case Done | Immediate => this
Expand Down Expand Up @@ -293,11 +293,11 @@ object Schedule:
final case class Min(a: Schedule, b: Schedule) extends Schedule:
def next =
a.next match
case Maybe.Empty => b.next
case n @ Maybe.Defined((d1, s1)) =>
case Absent => b.next
case n @ Present((d1, s1)) =>
b.next match
case Maybe.Empty => n
case Maybe.Defined((d2, s2)) =>
case Absent => n
case Present((d2, s2)) =>
Maybe((d1.min(d2), s1.min(s2)))
def show = s"(${a.show}).min(${b.show})"
end Min
Expand Down

0 comments on commit 9660dca

Please sign in to comment.