Skip to content

[NFC] Fix up some warnings #3139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Sources/Foundation/NSDecimalNumber.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ open class NSDecimalNumber : NSNumber {
return NSDecimalNumber(integerLiteral: 1)
}
open class var minimum: NSDecimalNumber {
return NSDecimalNumber(decimal:Decimal.leastFiniteMagnitude)
return NSDecimalNumber(decimal: -Decimal.greatestFiniteMagnitude)
}
open class var maximum: NSDecimalNumber {
return NSDecimalNumber(decimal:Decimal.greatestFiniteMagnitude)
return NSDecimalNumber(decimal: Decimal.greatestFiniteMagnitude)

}
open class var notANumber: NSDecimalNumber {
Expand Down
8 changes: 1 addition & 7 deletions Sources/Foundation/NSSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,7 @@ open class NSSet : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NSCodi

public convenience init(set: Set<AnyHashable>, copyItems flag: Bool) {
if flag {
self.init(array: set.map {
if let item = $0 as? NSObject {
return item.copy()
} else {
return $0
}
})
self.init(array: set.map{ ($0 as NSObject).copy() })
} else {
self.init(array: Array(set))
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/RunLoop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ extension RunLoop {
}

@available(*, deprecated, message: "For XCTest use only.")
open func _remove(_ source: _Source, for mode: RunLoop.Mode) {
public func _remove(_ source: _Source, for mode: RunLoop.Mode) {
CFRunLoopRemoveSource(_cfRunLoop, source.cfSource, mode._cfStringUniquingKnown)
}
}
Expand Down
16 changes: 2 additions & 14 deletions Sources/Foundation/URL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -655,13 +655,7 @@ public struct URL : ReferenceConvertible, Equatable {
/// - note: This function will resolve against the base `URL`.
/// - returns: The path, or an empty string if the URL has an empty path.
public var path: String {
if let parameterString = _url.parameterString {
if let path = _url.path {
return path + ";" + parameterString
} else {
return ";" + parameterString
}
} else if let path = _url.path {
if let path = _url.path {
return path
} else {
return ""
Expand All @@ -676,13 +670,7 @@ public struct URL : ReferenceConvertible, Equatable {
/// - note: This function will resolve against the base `URL`.
/// - returns: The relative path, or an empty string if the URL has an empty path.
public var relativePath: String {
if let parameterString = _url.parameterString {
if let path = _url.relativePath {
return path + ";" + parameterString
} else {
return ";" + parameterString
}
} else if let path = _url.relativePath {
if let path = _url.relativePath {
return path
} else {
return ""
Expand Down