Skip to content

Commit f4153f8

Browse files
Merge pull request #2 from apple/main
Fix huge compile time of setUUIDBytes (apple#2482)
2 parents 36d844c + b0d43ec commit f4153f8

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

Sources/NIOFoundationCompat/ByteBuffer-foundation.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -315,23 +315,23 @@ extension ByteBuffer {
315315
let bytes = uuid.uuid
316316

317317
// Pack the bytes into two 'UInt64's and set them.
318-
let chunk1 = UInt64(bytes.0) << 56
319-
| UInt64(bytes.1) << 48
320-
| UInt64(bytes.2) << 40
321-
| UInt64(bytes.3) << 32
322-
| UInt64(bytes.4) << 24
323-
| UInt64(bytes.5) << 16
324-
| UInt64(bytes.6) << 8
325-
| UInt64(bytes.7)
326-
327-
let chunk2 = UInt64(bytes.8) << 56
328-
| UInt64(bytes.9) << 48
329-
| UInt64(bytes.10) << 40
330-
| UInt64(bytes.11) << 32
331-
| UInt64(bytes.12) << 24
332-
| UInt64(bytes.13) << 16
333-
| UInt64(bytes.14) << 8
334-
| UInt64(bytes.15)
318+
var chunk1 = UInt64(bytes.0) << 56
319+
chunk1 |= UInt64(bytes.1) << 48
320+
chunk1 |= UInt64(bytes.2) << 40
321+
chunk1 |= UInt64(bytes.3) << 32
322+
chunk1 |= UInt64(bytes.4) << 24
323+
chunk1 |= UInt64(bytes.5) << 16
324+
chunk1 |= UInt64(bytes.6) << 8
325+
chunk1 |= UInt64(bytes.7)
326+
327+
var chunk2 = UInt64(bytes.8) << 56
328+
chunk2 |= UInt64(bytes.9) << 48
329+
chunk2 |= UInt64(bytes.10) << 40
330+
chunk2 |= UInt64(bytes.11) << 32
331+
chunk2 |= UInt64(bytes.12) << 24
332+
chunk2 |= UInt64(bytes.13) << 16
333+
chunk2 |= UInt64(bytes.14) << 8
334+
chunk2 |= UInt64(bytes.15)
335335

336336
var written = self.setInteger(chunk1, at: index)
337337
written &+= self.setInteger(chunk2, at: index &+ written)

0 commit comments

Comments
 (0)