@@ -422,12 +422,14 @@ extension ProgressManager {
422
422
/// where both the value and summary types are `Int`.
423
423
/// - Returns: An `Int` summary value for the specified property.
424
424
public func summary< P: Property > ( of property: P . Type ) -> P . Summary where P. Value == Int , P. Summary == Int {
425
- self . access ( keyPath: \. additionalPropertiesSink)
426
425
if property. self == ProgressManager . Properties. TotalFileCount. self {
426
+ self . access ( keyPath: \. totalFileCount)
427
427
return updatedFileCount ( type: . total)
428
428
} else if property. self == ProgressManager . Properties. CompletedFileCount. self {
429
+ self . access ( keyPath: \. completedFileCount)
429
430
return updatedFileCount ( type: . completed)
430
431
} else {
432
+ self . access ( keyPath: \. additionalPropertiesSink)
431
433
return updatedIntSummary ( property: MetatypeWrapper ( property) )
432
434
}
433
435
}
@@ -443,16 +445,12 @@ extension ProgressManager {
443
445
public func summary< P: Property > ( of property: P . Type ) -> P . Summary where P. Value == UInt64 , P. Summary == UInt64 {
444
446
if property. self == ProgressManager . Properties. TotalByteCount. self {
445
447
self . access ( keyPath: \. totalByteCount)
446
- } else if property. self == ProgressManager . Properties. CompletedByteCount. self {
447
- self . access ( keyPath: \. completedByteCount)
448
- } else {
449
- self . access ( keyPath: \. additionalPropertiesSink)
450
- }
451
- if property. self == ProgressManager . Properties. TotalByteCount. self {
452
448
return updatedByteCount ( type: . total)
453
449
} else if property. self == ProgressManager . Properties. CompletedByteCount. self {
450
+ self . access ( keyPath: \. completedByteCount)
454
451
return updatedByteCount ( type: . completed)
455
452
} else {
453
+ self . access ( keyPath: \. additionalPropertiesSink)
456
454
return updatedUInt64Summary ( property: MetatypeWrapper ( property) )
457
455
}
458
456
}
@@ -507,12 +505,9 @@ extension ProgressManager {
507
505
public func summary< P: Property > ( of property: P . Type ) -> P . Summary where P. Value == UInt64 , P. Summary == [ UInt64 ] {
508
506
if property. self == ProgressManager . Properties. Throughput. self {
509
507
self . access ( keyPath: \. throughput)
510
- } else {
511
- self . access ( keyPath: \. additionalPropertiesSink)
512
- }
513
- if property. self == ProgressManager . Properties. Throughput. self {
514
508
return updatedThroughput ( )
515
509
} else {
510
+ self . access ( keyPath: \. additionalPropertiesSink)
516
511
return updatedUInt64ArraySummary ( property: MetatypeWrapper ( property) )
517
512
}
518
513
}
@@ -528,12 +523,9 @@ extension ProgressManager {
528
523
public func summary< P: Property > ( of property: P . Type ) -> P . Summary where P. Value == Duration , P. Summary == Duration {
529
524
if property. self == ProgressManager . Properties. EstimatedTimeRemaining. self {
530
525
self . access ( keyPath: \. estimatedTimeRemaining)
531
- } else {
532
- self . access ( keyPath: \. additionalPropertiesSink)
533
- }
534
- if property. self == ProgressManager . Properties. EstimatedTimeRemaining. self {
535
526
return updatedEstimatedTimeRemaining ( )
536
527
} else {
528
+ self . access ( keyPath: \. additionalPropertiesSink)
537
529
return updatedDurationSummary ( property: MetatypeWrapper ( property) )
538
530
}
539
531
}
0 commit comments