mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-02 19:38:17 +00:00
[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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user