Skip to content

Commit

Permalink
Changed genericByteArray to correct the test results after Xcode upda…
Browse files Browse the repository at this point in the history
…te on 7 beta4
  • Loading branch information
Gabriele authored and Gabriele committed Aug 12, 2015
1 parent ce55a86 commit cf501d2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func getGenericByteArray<T : GenericIntegerType where T : UnsignedIntegerType, T
let sizeofT = sizeof(T)
var ret = [UInt8](count: sizeofT, repeatedValue: 0)

for (var j = sizeofT - 1 ; j >= 0; j--) {
ret[j] = UInt8((unsInt.toUIntMax() >> UIntMax(j * 8)) & 0xFF)
for (var j = 0 ; j < sizeofT ; j++) {
ret[sizeofT - j - 1] = UInt8((unsInt.toUIntMax() >> UIntMax(j * 8)) & 0xFF)
}

return ret
Expand All @@ -88,8 +88,8 @@ func getGenericByteArray<T : GenericIntegerType where T : SignedIntegerType, T :
let sizeofT = sizeof(T)
var ret = [UInt8](count: sizeofT, repeatedValue: 0)

for (var j = sizeofT - 1 ; j >= 0; j--) {
ret[j] = UInt8((unsInt.toIntMax() >> IntMax(j * 8)) & 0xFF)
for (var j = 0 ; j < sizeofT; j++) {
ret[sizeofT - j - 1] = UInt8((unsInt.toIntMax() >> IntMax(j * 8)) & 0xFF)
}

return ret
Expand Down

0 comments on commit cf501d2

Please sign in to comment.