[Swift] Internal library improvements (#5965)

* Moves addition to overflow addition in swift by using &+

Moves code to use Int instead of UInt32 & fixes functions

Updates swift performance to great

Updated version to 0.5.2

Updated swift package version to 5.2

Updated docker to swift 5.2

Removed all none & arithmetic operations

* Small refactoring
This commit is contained in:
mustiikhalil
2020-06-18 20:14:38 +03:00
committed by GitHub
parent cfc7753a4c
commit 2e57d80b13
7 changed files with 71 additions and 80 deletions

View File

@@ -29,8 +29,7 @@ extension Scalar where Self: FixedWidthInteger {
///
/// Converts values to little endian on machines that work with BigEndian, however this is NOT TESTED yet.
public var convertedEndian: NumericValue {
if isLitteEndian { return self as! Self.NumericValue }
fatalError("This is not tested! please report an issue on the offical flatbuffers repo")
return self as! Self.NumericValue
}
}
@@ -38,7 +37,6 @@ extension Double: Scalar {
public typealias NumericValue = UInt64
public var convertedEndian: UInt64 {
if isLitteEndian { return self.bitPattern }
return self.bitPattern.littleEndian
}
}
@@ -47,7 +45,6 @@ extension Float32: Scalar {
public typealias NumericValue = UInt32
public var convertedEndian: UInt32 {
if isLitteEndian { return self.bitPattern }
return self.bitPattern.littleEndian
}
}