mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
Replace UInt extensions with one extension to UnsignedInteger
This commit is contained in:
@@ -19,36 +19,11 @@ extension Data {
|
||||
|
||||
}
|
||||
|
||||
extension UInt8 {
|
||||
extension UnsignedInteger {
|
||||
|
||||
func toInt() -> Int {
|
||||
return Int(bitPattern: UInt(self))
|
||||
return Int(truncatingIfNeeded: self)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension UInt16 {
|
||||
|
||||
func toInt() -> Int {
|
||||
return Int(bitPattern: UInt(self))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension UInt32 {
|
||||
|
||||
func toInt() -> Int {
|
||||
return Int(bitPattern: UInt(self))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension UInt64 {
|
||||
|
||||
func toInt() -> Int {
|
||||
return Int(bitPattern: UInt(self))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension Int {
|
||||
|
||||
Reference in New Issue
Block a user