Skip to content

Commit 738a27c

Browse files
committed
fix(ci): simplify binary readers for Swift compiler on macOS-15 runners
1 parent 8ac09d3 commit 738a27c

2 files changed

Lines changed: 14 additions & 15 deletions

File tree

Package.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ let package = Package(
2121
name: "Dictionary",
2222
dependencies: [],
2323
path: "Sources/Dictionary",
24-
exclude: [
25-
"Resources/uk_full.txt"
26-
],
2724
resources: [
2825
.copy("Resources/en_US.txt"),
2926
.copy("Resources/ru_RU.txt"),

Sources/Dictionary/DictionaryBinaryFormat.swift

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,23 @@ enum DictionaryBinaryFormat {
9393

9494
static func readUInt32(from data: Data, at offset: Int) -> UInt32 {
9595
precondition(offset + 4 <= data.count, "Out-of-bounds UInt32 read")
96-
return UInt32(data[offset])
97-
| (UInt32(data[offset + 1]) << 8)
98-
| (UInt32(data[offset + 2]) << 16)
99-
| (UInt32(data[offset + 3]) << 24)
96+
let b0 = UInt32(data[offset])
97+
let b1 = UInt32(data[offset + 1]) << 8
98+
let b2 = UInt32(data[offset + 2]) << 16
99+
let b3 = UInt32(data[offset + 3]) << 24
100+
return b0 | b1 | b2 | b3
100101
}
101102

102103
static func readUInt64(from data: Data, at offset: Int) -> UInt64 {
103104
precondition(offset + 8 <= data.count, "Out-of-bounds UInt64 read")
104-
return UInt64(data[offset])
105-
| (UInt64(data[offset + 1]) << 8)
106-
| (UInt64(data[offset + 2]) << 16)
107-
| (UInt64(data[offset + 3]) << 24)
108-
| (UInt64(data[offset + 4]) << 32)
109-
| (UInt64(data[offset + 5]) << 40)
110-
| (UInt64(data[offset + 6]) << 48)
111-
| (UInt64(data[offset + 7]) << 56)
105+
let b0 = UInt64(data[offset])
106+
let b1 = UInt64(data[offset + 1]) << 8
107+
let b2 = UInt64(data[offset + 2]) << 16
108+
let b3 = UInt64(data[offset + 3]) << 24
109+
let b4 = UInt64(data[offset + 4]) << 32
110+
let b5 = UInt64(data[offset + 5]) << 40
111+
let b6 = UInt64(data[offset + 6]) << 48
112+
let b7 = UInt64(data[offset + 7]) << 56
113+
return b0 | b1 | b2 | b3 | b4 | b5 | b6 | b7
112114
}
113115
}

0 commit comments

Comments
 (0)