Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions stdlib/public/core/Algorithm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public func find<
@warn_unused_result
public func min<T : Comparable>(x: T, _ y: T) -> T {
var r = x
if y < x {
if y < r {
r = y
}
return r
Expand All @@ -57,7 +57,7 @@ public func min<T : Comparable>(x: T, _ y: T) -> T {
@warn_unused_result
public func min<T : Comparable>(x: T, _ y: T, _ z: T, _ rest: T...) -> T {
var r = x
if y < x {
if y < r {
r = y
}
if z < r {
Expand All @@ -75,7 +75,7 @@ public func min<T : Comparable>(x: T, _ y: T, _ z: T, _ rest: T...) -> T {
@warn_unused_result
public func max<T : Comparable>(x: T, _ y: T) -> T {
var r = y
if y < x {
if r < x {
r = x
}
return r
Expand All @@ -85,14 +85,14 @@ public func max<T : Comparable>(x: T, _ y: T) -> T {
@warn_unused_result
public func max<T : Comparable>(x: T, _ y: T, _ z: T, _ rest: T...) -> T {
var r = y
if y < x {
if r < x {
r = x
}
if r < z {
r = z
}
for t in rest {
if t >= r {
if r <= t {
r = t
}
}
Expand Down