stdlib: adopt @warn_unused_result

rdar://20957486

Swift SVN r31048
This commit is contained in:
Dmitri Hrybenko
2015-08-06 14:53:18 +00:00
parent 10bdef0936
commit dd3194a18c
74 changed files with 789 additions and 82 deletions

View File

@@ -44,6 +44,7 @@ public func find<
}
/// Returns the lesser of `x` and `y`.
@warn_unused_result
public func min<T : Comparable>(x: T, _ y: T) -> T {
var r = x
if y < x {
@@ -53,6 +54,7 @@ public func min<T : Comparable>(x: T, _ y: T) -> T {
}
/// Returns the least argument passed.
@warn_unused_result
public func min<T : Comparable>(x: T, _ y: T, _ z: T, _ rest: T...) -> T {
var r = x
if y < x {
@@ -70,6 +72,7 @@ public func min<T : Comparable>(x: T, _ y: T, _ z: T, _ rest: T...) -> T {
}
/// Returns the greater of `x` and `y`.
@warn_unused_result
public func max<T : Comparable>(x: T, _ y: T) -> T {
var r = y
if y < x {
@@ -79,6 +82,7 @@ public func max<T : Comparable>(x: T, _ y: T) -> T {
}
/// Returns the greatest argument passed.
@warn_unused_result
public func max<T : Comparable>(x: T, _ y: T, _ z: T, _ rest: T...) -> T {
var r = y
if y < x {