Skip to content

Commit f796af9

Browse files
committed
Clean up comments
1 parent 2ac05c6 commit f796af9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Sources/Hub/Downloader.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,15 +265,14 @@ final class Downloader: NSObject, Sendable, ObservableObject {
265265
do {
266266
// Batch collect bytes to reduce Data.append() overhead
267267
// Use ContiguousArray for better performance (no NSArray bridging overhead)
268-
// Larger batch size = fewer Data.append calls
269-
let batchSize = 16384 // 16KB batches
268+
let batchSize = 16384 // 16 kB
270269
var byteBatch = ContiguousArray<UInt8>()
271270
byteBatch.reserveCapacity(batchSize)
272271

273272
for try await byte in asyncBytes {
274273
byteBatch.append(byte)
275274

276-
// When we've collected a batch, append to main buffer
275+
// Append batch to main buffer
277276
if byteBatch.count >= batchSize {
278277
buffer.append(contentsOf: byteBatch)
279278
byteBatch.removeAll(keepingCapacity: true)
@@ -466,7 +465,6 @@ actor Broadcaster<E: Sendable> {
466465

467466
func broadcast(state: E) async {
468467
latestState = state
469-
// continuation.yield() is already async-safe, no need to wrap in Tasks
470468
for continuation in continuations.values {
471469
continuation.yield(state)
472470
}

0 commit comments

Comments
 (0)