Skip to content

Commit f2bb6b9

Browse files
committed
remove setTotalCount method
1 parent 3569d2d commit f2bb6b9

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

Sources/FoundationEssentials/ProgressManager/ProgressManager.swift

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -250,34 +250,6 @@ internal struct AnyMetatypeWrapper: Hashable, Equatable, Sendable {
250250
self.init(total: totalCount, ghostReporter: nil, interopObservation: nil)
251251
}
252252

253-
/// Sets `totalCount`.
254-
/// - Parameter newTotal: Total units of work.
255-
public func setTotalCount(_ newTotal: Int?) {
256-
state.withLock { state in
257-
let previous = state.fractionState.overallFraction
258-
if state.fractionState.selfFraction.total != newTotal && state.fractionState.selfFraction.total > 0 {
259-
state.fractionState.childFraction = state.fractionState.childFraction * _ProgressFraction(completed: state.fractionState.selfFraction.total, total: newTotal ?? 1)
260-
}
261-
state.fractionState.selfFraction.total = newTotal ?? 0
262-
263-
// if newValue is nil, reset indeterminate to true
264-
if newTotal != nil {
265-
state.fractionState.indeterminate = false
266-
} else {
267-
state.fractionState.indeterminate = true
268-
}
269-
updateFractionCompleted(from: previous, to: state.fractionState.overallFraction)
270-
271-
ghostReporter?.notifyObservers(with: .totalCountUpdated)
272-
273-
monitorInterop.withLock { [self] interop in
274-
if interop == true {
275-
notifyObservers(with: .totalCountUpdated)
276-
}
277-
}
278-
}
279-
}
280-
281253
/// Returns a `Subprogress` representing a portion of `self` which can be passed to any method that reports progress.
282254
///
283255
/// - Parameter count: Units, which is a portion of `totalCount`delegated to an instance of `Subprogress`.

0 commit comments

Comments
 (0)