Skip to content

Commit 554ff02

Browse files
committed
rename helper methods to use update instead of updated
1 parent e2e35ac commit 554ff02

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

Sources/FoundationEssentials/ProgressManager/ProgressManager+Properties+Accessors.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -392,19 +392,19 @@ extension ProgressManager {
392392
if P.self == ProgressManager.Properties.TotalFileCount.self {
393393
self.access(keyPath: \.totalFileCount)
394394
self.access(keyPath: \.totalFileCountSummary)
395-
let updatedFileCount = updatedFileCount(type: .total)
395+
let updatedFileCount = updateFileCount(type: .total)
396396
self.didSet(keyPath: \.totalFileCountSummary)
397397
return updatedFileCount
398398
} else if P.self == ProgressManager.Properties.CompletedFileCount.self {
399399
self.access(keyPath: \.completedFileCount)
400400
self.access(keyPath: \.completedFileCountSummary)
401-
let updatedFileCount = updatedFileCount(type: .completed)
401+
let updatedFileCount = updateFileCount(type: .completed)
402402
self.didSet(keyPath: \.completedFileCountSummary)
403403
return updatedFileCount
404404
} else {
405405
self.access(keyPath: \.customPropertiesInt)
406406
self.access(keyPath: \.customPropertiesIntSummary)
407-
let updatedResult = updatedIntSummary(property: MetatypeWrapper(P.self))
407+
let updatedResult = updateIntSummary(property: MetatypeWrapper(P.self))
408408
self.didSet(keyPath: \.customPropertiesIntSummary)
409409
return updatedResult
410410
}
@@ -422,19 +422,19 @@ extension ProgressManager {
422422
if P.self == ProgressManager.Properties.TotalByteCount.self {
423423
self.access(keyPath: \.totalByteCount)
424424
self.access(keyPath: \.totalByteCountSummary)
425-
let updatedByteCount = updatedByteCount(type: .total)
425+
let updatedByteCount = updateByteCount(type: .total)
426426
self.didSet(keyPath: \.totalByteCountSummary)
427427
return updatedByteCount
428428
} else if P.self == ProgressManager.Properties.CompletedByteCount.self {
429429
self.access(keyPath: \.completedByteCount)
430430
self.access(keyPath: \.completedByteCountSummary)
431-
let updatedByteCount = updatedByteCount(type: .completed)
431+
let updatedByteCount = updateByteCount(type: .completed)
432432
self.didSet(keyPath: \.completedByteCountSummary)
433433
return updatedByteCount
434434
} else {
435435
self.access(keyPath: \.customPropertiesUInt64)
436436
self.access(keyPath: \.customPropertiesUInt64Summary)
437-
let updatedResult = updatedUInt64Summary(property: MetatypeWrapper(P.self))
437+
let updatedResult = updateUInt64Summary(property: MetatypeWrapper(P.self))
438438
self.didSet(keyPath: \.customPropertiesUInt64Summary)
439439
return updatedResult
440440
}
@@ -451,7 +451,7 @@ extension ProgressManager {
451451
public func summary<P: Property>(of property: KeyPath<ProgressManager.Properties, P.Type>) -> P.Summary where P.Value == Double, P.Summary == Double {
452452
self.access(keyPath: \.customPropertiesDouble)
453453
self.access(keyPath: \.customPropertiesDoubleSummary)
454-
let updatedResult = updatedDoubleSummary(property: MetatypeWrapper(P.self))
454+
let updatedResult = updateDoubleSummary(property: MetatypeWrapper(P.self))
455455
self.didSet(keyPath: \.customPropertiesDoubleSummary)
456456
return updatedResult
457457
}
@@ -467,7 +467,7 @@ extension ProgressManager {
467467
public func summary<P: Property>(of property: KeyPath<ProgressManager.Properties, P.Type>) -> P.Summary where P.Value == String?, P.Summary == [String?] {
468468
self.access(keyPath: \.customPropertiesString)
469469
self.access(keyPath: \.customPropertiesStringSummary)
470-
let updatedResult = updatedStringSummary(property: MetatypeWrapper(P.self))
470+
let updatedResult = updateStringSummary(property: MetatypeWrapper(P.self))
471471
self.didSet(keyPath: \.customPropertiesStringSummary)
472472
return updatedResult
473473
}
@@ -483,7 +483,7 @@ extension ProgressManager {
483483
public func summary<P: Property>(of property: KeyPath<ProgressManager.Properties, P.Type>) -> P.Summary where P.Value == URL?, P.Summary == [URL?] {
484484
self.access(keyPath: \.customPropertiesURL)
485485
self.access(keyPath: \.customPropertiesURLSummary)
486-
let updatedResult = updatedURLSummary(property: MetatypeWrapper(P.self))
486+
let updatedResult = updateURLSummary(property: MetatypeWrapper(P.self))
487487
self.didSet(keyPath: \.customPropertiesURLSummary)
488488
return updatedResult
489489
}
@@ -500,13 +500,13 @@ extension ProgressManager {
500500
if P.self == ProgressManager.Properties.Throughput.self {
501501
self.access(keyPath: \.throughput)
502502
self.access(keyPath: \.throughputSummary)
503-
let updatedThroughput = updatedThroughput()
503+
let updatedThroughput = updateThroughput()
504504
self.didSet(keyPath: \.throughputSummary)
505505
return updatedThroughput
506506
} else {
507507
self.access(keyPath: \.customPropertiesUInt64Array)
508508
self.access(keyPath: \.customPropertiesUInt64ArraySummary)
509-
let updatedResult = updatedUInt64ArraySummary(property: MetatypeWrapper(P.self))
509+
let updatedResult = updateUInt64ArraySummary(property: MetatypeWrapper(P.self))
510510
self.didSet(keyPath: \.customPropertiesUInt64ArraySummary)
511511
return updatedResult
512512
}
@@ -524,13 +524,13 @@ extension ProgressManager {
524524
if P.self == ProgressManager.Properties.EstimatedTimeRemaining.self {
525525
self.access(keyPath: \.estimatedTimeRemaining)
526526
self.access(keyPath: \.estimatedTimeRemainingSummary)
527-
let updatedTimeRemaining = updatedEstimatedTimeRemaining()
527+
let updatedTimeRemaining = updateEstimatedTimeRemaining()
528528
self.didSet(keyPath: \.estimatedTimeRemainingSummary)
529529
return updatedTimeRemaining
530530
} else {
531531
self.access(keyPath: \.customPropertiesDuration)
532532
self.access(keyPath: \.customPropertiesDurationSummary)
533-
let updatedResult = updatedDurationSummary(property: MetatypeWrapper(P.self))
533+
let updatedResult = updateDurationSummary(property: MetatypeWrapper(P.self))
534534
self.didSet(keyPath: \.customPropertiesDurationSummary)
535535
return updatedResult
536536
}

Sources/FoundationEssentials/ProgressManager/ProgressManager+Properties+Helpers.swift

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ extension ProgressManager {
2323
}
2424

2525
//MARK: Helper Methods for Updating Dirty Path
26-
internal func updatedIntSummary(property: MetatypeWrapper<Int, Int>) -> Int {
26+
internal func updateIntSummary(property: MetatypeWrapper<Int, Int>) -> Int {
2727
// Get information about dirty children and summaries of non-dirty children
2828
let updateInfo = state.withLock { state in
2929
state.getIntSummaryUpdateInfo(property: property)
3030
}
3131

3232
// Get updated summary for each dirty child
3333
let updatedSummaries = updateInfo.dirtyChildren.map { (index, child) in
34-
State.IntSummaryUpdate(index: index, updatedSummary: child.updatedIntSummary(property: property))
34+
State.IntSummaryUpdate(index: index, updatedSummary: child.updateIntSummary(property: property))
3535
}
3636

3737
// Consolidate updated summaries of dirty children and summaries of non-dirty children
@@ -40,15 +40,15 @@ extension ProgressManager {
4040
}
4141
}
4242

43-
internal func updatedUInt64Summary(property: MetatypeWrapper<UInt64, UInt64>) -> UInt64 {
43+
internal func updateUInt64Summary(property: MetatypeWrapper<UInt64, UInt64>) -> UInt64 {
4444
// Get information about dirty children and summaries of non-dirty children
4545
let updateInfo = state.withLock { state in
4646
state.getUInt64SummaryUpdateInfo(property: property)
4747
}
4848

4949
// Get updated summary for each dirty child
5050
let updatedSummaries = updateInfo.dirtyChildren.map { (index, child) in
51-
State.UInt64SummaryUpdate(index: index, updatedSummary: child.updatedUInt64Summary(property: property))
51+
State.UInt64SummaryUpdate(index: index, updatedSummary: child.updateUInt64Summary(property: property))
5252
}
5353

5454
// Consolidate updated summaries of dirty children and summaries of non-dirty children
@@ -57,15 +57,15 @@ extension ProgressManager {
5757
}
5858
}
5959

60-
internal func updatedDoubleSummary(property: MetatypeWrapper<Double, Double>) -> Double {
60+
internal func updateDoubleSummary(property: MetatypeWrapper<Double, Double>) -> Double {
6161
// Get information about dirty children and summaries of non-dirty children
6262
let updateInfo = state.withLock { state in
6363
state.getDoubleSummaryUpdateInfo(property: property)
6464
}
6565

6666
// Get updated summary for each dirty child
6767
let updatedSummaries = updateInfo.dirtyChildren.map { (index, child) in
68-
State.DoubleSummaryUpdate(index: index, updatedSummary: child.updatedDoubleSummary(property: property))
68+
State.DoubleSummaryUpdate(index: index, updatedSummary: child.updateDoubleSummary(property: property))
6969
}
7070

7171
// Consolidate updated summaries of dirty children and summaries of non-dirty children
@@ -74,15 +74,15 @@ extension ProgressManager {
7474
}
7575
}
7676

77-
internal func updatedStringSummary(property: MetatypeWrapper<String?, [String?]>) -> [String?] {
77+
internal func updateStringSummary(property: MetatypeWrapper<String?, [String?]>) -> [String?] {
7878
// Get information about dirty children and summaries of non-dirty children
7979
let updateInfo = state.withLock { state in
8080
state.getStringSummaryUpdateInfo(property: property)
8181
}
8282

8383
// Get updated summary for each dirty child
8484
let updatedSummaries = updateInfo.dirtyChildren.map { (index, child) in
85-
State.StringSummaryUpdate(index: index, updatedSummary: child.updatedStringSummary(property: property))
85+
State.StringSummaryUpdate(index: index, updatedSummary: child.updateStringSummary(property: property))
8686
}
8787

8888
// Consolidate updated summaries of dirty children and summaries of non-dirty children
@@ -91,15 +91,15 @@ extension ProgressManager {
9191
}
9292
}
9393

94-
internal func updatedURLSummary(property: MetatypeWrapper<URL?, [URL?]>) -> [URL?] {
94+
internal func updateURLSummary(property: MetatypeWrapper<URL?, [URL?]>) -> [URL?] {
9595
// Get information about dirty children and summaries of non-dirty children
9696
let updateInfo = state.withLock { state in
9797
state.getURLSummaryUpdateInfo(property: property)
9898
}
9999

100100
// Get updated summary for each dirty child
101101
let updatedSummaries = updateInfo.dirtyChildren.map { (index, child) in
102-
State.URLSummaryUpdate(index: index, updatedSummary: child.updatedURLSummary(property: property))
102+
State.URLSummaryUpdate(index: index, updatedSummary: child.updateURLSummary(property: property))
103103
}
104104

105105
// Consolidate updated summaries of dirty children and summaries of non-dirty children
@@ -108,15 +108,15 @@ extension ProgressManager {
108108
}
109109
}
110110

111-
internal func updatedUInt64ArraySummary(property: MetatypeWrapper<UInt64, [UInt64]>) -> [UInt64] {
111+
internal func updateUInt64ArraySummary(property: MetatypeWrapper<UInt64, [UInt64]>) -> [UInt64] {
112112
// Get information about dirty children and summaries of non-dirty children
113113
let updateInfo = state.withLock { state in
114114
state.getUInt64ArraySummaryUpdateInfo(property: property)
115115
}
116116

117117
// Get updated summary for each dirty child
118118
let updatedSummaries = updateInfo.dirtyChildren.map { (index, child) in
119-
State.UInt64ArraySummaryUpdate(index: index, updatedSummary: child.updatedUInt64ArraySummary(property: property))
119+
State.UInt64ArraySummaryUpdate(index: index, updatedSummary: child.updateUInt64ArraySummary(property: property))
120120
}
121121

122122
// Consolidate updated summaries of dirty children and summaries of non-dirty children
@@ -125,15 +125,15 @@ extension ProgressManager {
125125
}
126126
}
127127

128-
internal func updatedDurationSummary(property: MetatypeWrapper<Duration, Duration>) -> Duration {
128+
internal func updateDurationSummary(property: MetatypeWrapper<Duration, Duration>) -> Duration {
129129
// Get information about dirty children and summaries of non-dirty children
130130
let updateInfo = state.withLock { state in
131131
state.getDurationSummaryUpdateInfo(property: property)
132132
}
133133

134134
// Get updated summary for each dirty child
135135
let updatedSummaries = updateInfo.dirtyChildren.map { (index, child) in
136-
State.DurationSummaryUpdate(index: index, updatedSummary: child.updatedDurationSummary(property: property))
136+
State.DurationSummaryUpdate(index: index, updatedSummary: child.updateDurationSummary(property: property))
137137
}
138138

139139
// Consolidate updated summaries of dirty children and summaries of non-dirty children
@@ -142,15 +142,15 @@ extension ProgressManager {
142142
}
143143
}
144144

145-
internal func updatedFileCount(type: CountType) -> Int {
145+
internal func updateFileCount(type: CountType) -> Int {
146146
// Get information about dirty children and summaries of non-dirty children
147147
let updateInfo = state.withLock { state in
148148
state.getFileCountUpdateInfo(type: type)
149149
}
150150

151151
// Get updated summary for each dirty child
152152
let updatedSummaries = updateInfo.dirtyChildren.map { (index, child) in
153-
State.FileCountUpdate(index: index, updatedSummary: child.updatedFileCount(type: type))
153+
State.FileCountUpdate(index: index, updatedSummary: child.updateFileCount(type: type))
154154
}
155155

156156
// Consolidate updated summaries of dirty children and summaries of non-dirty children
@@ -159,15 +159,15 @@ extension ProgressManager {
159159
}
160160
}
161161

162-
internal func updatedByteCount(type: CountType) -> UInt64 {
162+
internal func updateByteCount(type: CountType) -> UInt64 {
163163
// Get information about dirty children and summaries of non-dirty children
164164
let updateInfo = state.withLock { state in
165165
state.getByteCountUpdateInfo(type: type)
166166
}
167167

168168
// Get updated summary for each dirty child
169169
let updatedSummaries = updateInfo.dirtyChildren.map { (index, child) in
170-
State.ByteCountUpdate(index: index, updatedSummary: child.updatedByteCount(type: type))
170+
State.ByteCountUpdate(index: index, updatedSummary: child.updateByteCount(type: type))
171171
}
172172

173173
// Consolidate updated summaries of dirty children and summaries of non-dirty children
@@ -176,32 +176,32 @@ extension ProgressManager {
176176
}
177177
}
178178

179-
internal func updatedThroughput() -> [UInt64] {
179+
internal func updateThroughput() -> [UInt64] {
180180
// Get information about dirty children and summaries of non-dirty children
181181
let updateInfo = state.withLock { state in
182182
state.getThroughputUpdateInfo()
183183
}
184184

185185
// Get updated summary for each dirty child
186186
let updatedSummaries = updateInfo.dirtyChildren.map { (index, child) in
187-
State.ThroughputUpdate(index: index, updatedSummary: child.updatedThroughput())
187+
State.ThroughputUpdate(index: index, updatedSummary: child.updateThroughput())
188188
}
189189

190190
// Consolidate updated summaries of dirty children and summaries of non-dirty children
191191
return state.withLock { state in
192-
state.updatedThroughput(updateInfo, updatedSummaries)
192+
state.updateThroughput(updateInfo, updatedSummaries)
193193
}
194194
}
195195

196-
internal func updatedEstimatedTimeRemaining() -> Duration {
196+
internal func updateEstimatedTimeRemaining() -> Duration {
197197
// Get information about dirty children and summaries of non-dirty children
198198
let updateInfo = state.withLock { state in
199199
state.getEstimatedTimeRemainingUpdateInfo()
200200
}
201201

202202
// Get updated summary for each dirty child
203203
let updatedSummaries = updateInfo.dirtyChildren.map { (index, child) in
204-
State.EstimatedTimeRemainingUpdate(index: index, updatedSummary: child.updatedEstimatedTimeRemaining())
204+
State.EstimatedTimeRemainingUpdate(index: index, updatedSummary: child.updateEstimatedTimeRemaining())
205205
}
206206

207207
// Consolidate updated summaries of dirty children and summaries of non-dirty children

Sources/FoundationEssentials/ProgressManager/ProgressManager+State.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ extension ProgressManager {
13201320
)
13211321
}
13221322

1323-
internal mutating func updatedThroughput(_ updateInfo: ThroughputUpdateInfo, _ childUpdates: [ThroughputUpdate]) -> [UInt64] {
1323+
internal mutating func updateThroughput(_ updateInfo: ThroughputUpdateInfo, _ childUpdates: [ThroughputUpdate]) -> [UInt64] {
13241324
var value = updateInfo.currentSummary
13251325

13261326
// Apply updates from children that were dirty

0 commit comments

Comments
 (0)