mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
Inline generic min and max - https://github.com/nim-lang/Nim/issues/9514 (#9688)
This commit is contained in:
committed by
Andreas Rumpf
parent
b5448bf25c
commit
b65c0c336c
@@ -2253,10 +2253,10 @@ proc min*(x, y: float): float {.magic: "MinF64", noSideEffect.} =
|
||||
proc max*(x, y: float): float {.magic: "MaxF64", noSideEffect.} =
|
||||
if y <= x: x else: y
|
||||
|
||||
proc min*[T](x, y: T): T =
|
||||
proc min*[T](x, y: T): T {.inline.}=
|
||||
if x <= y: x else: y
|
||||
|
||||
proc max*[T](x, y: T): T =
|
||||
proc max*[T](x, y: T): T {.inline.}=
|
||||
if y <= x: x else: y
|
||||
{.pop.}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user