Skip to content

Commit c5613b3

Browse files
committed
remove get prefix from helper methods
1 parent a416bee commit c5613b3

File tree

4 files changed

+52
-52
lines changed

4 files changed

+52
-52
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -570,11 +570,11 @@ extension ProgressManager {
570570
public func summary<P: Property>(of property: P.Type) -> P.Summary where P.Value == Int, P.Summary == Int {
571571
accessObservation(keyPath: ProgressManager.additionalPropertiesKeyPath.withLock { $0 })
572572
if property.self == ProgressManager.Properties.TotalFileCount.self {
573-
return getUpdatedFileCount(type: .total)
573+
return updatedFileCount(type: .total)
574574
} else if property.self == ProgressManager.Properties.CompletedFileCount.self {
575-
return getUpdatedFileCount(type: .completed)
575+
return updatedFileCount(type: .completed)
576576
} else {
577-
return getUpdatedIntSummary(property: MetatypeWrapper(property))
577+
return updatedIntSummary(property: MetatypeWrapper(property))
578578
}
579579
}
580580

@@ -589,11 +589,11 @@ extension ProgressManager {
589589
public func summary<P: Property>(of property: P.Type) -> P.Summary where P.Value == UInt64, P.Summary == UInt64 {
590590
accessObservation(keyPath: ProgressManager.additionalPropertiesKeyPath.withLock { $0 })
591591
if property.self == ProgressManager.Properties.TotalByteCount.self {
592-
return getUpdatedByteCount(type: .total)
592+
return updatedByteCount(type: .total)
593593
} else if property.self == ProgressManager.Properties.CompletedByteCount.self {
594-
return getUpdatedByteCount(type: .completed)
594+
return updatedByteCount(type: .completed)
595595
} else {
596-
return getUpdatedUInt64Summary(property: MetatypeWrapper(property))
596+
return updatedUInt64Summary(property: MetatypeWrapper(property))
597597
}
598598
}
599599

@@ -607,7 +607,7 @@ extension ProgressManager {
607607
/// - Returns: A `Double` summary value for the specified property.
608608
public func summary<P: Property>(of property: P.Type) -> P.Summary where P.Value == Double, P.Summary == Double {
609609
accessObservation(keyPath: ProgressManager.additionalPropertiesKeyPath.withLock { $0 })
610-
return getUpdatedDoubleSummary(property: MetatypeWrapper(property))
610+
return updatedDoubleSummary(property: MetatypeWrapper(property))
611611
}
612612

613613
/// Returns a summary for a custom string property across the progress subtree.
@@ -620,7 +620,7 @@ extension ProgressManager {
620620
/// - Returns: A `[String?]` summary value for the specified property.
621621
public func summary<P: Property>(of property: P.Type) -> P.Summary where P.Value == String?, P.Summary == [String?] {
622622
accessObservation(keyPath: ProgressManager.additionalPropertiesKeyPath.withLock { $0 })
623-
return getUpdatedStringSummary(property: MetatypeWrapper(property))
623+
return updatedStringSummary(property: MetatypeWrapper(property))
624624
}
625625

626626
/// Returns a summary for a custom URL property across the progress subtree.
@@ -633,7 +633,7 @@ extension ProgressManager {
633633
/// - Returns: A `[URL?]` summary value for the specified property.
634634
public func summary<P: Property>(of property: P.Type) -> P.Summary where P.Value == URL?, P.Summary == [URL?] {
635635
accessObservation(keyPath: ProgressManager.additionalPropertiesKeyPath.withLock { $0 })
636-
return getUpdatedURLSummary(property: MetatypeWrapper(property))
636+
return updatedURLSummary(property: MetatypeWrapper(property))
637637
}
638638

639639
/// Returns a summary for a custom unsigned integer property across the progress subtree.
@@ -647,9 +647,9 @@ extension ProgressManager {
647647
public func summary<P: Property>(of property: P.Type) -> P.Summary where P.Value == UInt64, P.Summary == [UInt64] {
648648
accessObservation(keyPath: ProgressManager.additionalPropertiesKeyPath.withLock { $0 })
649649
if property.self == ProgressManager.Properties.Throughput.self {
650-
return getUpdatedThroughput()
650+
return updatedThroughput()
651651
} else {
652-
return getUpdatedUInt64ArraySummary(property: MetatypeWrapper(property))
652+
return updatedUInt64ArraySummary(property: MetatypeWrapper(property))
653653
}
654654
}
655655

@@ -664,9 +664,9 @@ extension ProgressManager {
664664
public func summary<P: Property>(of property: P.Type) -> P.Summary where P.Value == Duration, P.Summary == Duration {
665665
accessObservation(keyPath: ProgressManager.additionalPropertiesKeyPath.withLock { $0 })
666666
if property.self == ProgressManager.Properties.EstimatedTimeRemaining.self {
667-
return getUpdatedEstimatedTimeRemaining()
667+
return updatedEstimatedTimeRemaining()
668668
} else {
669-
return getUpdatedDurationSummary(property: MetatypeWrapper(property))
669+
return updatedDurationSummary(property: MetatypeWrapper(property))
670670
}
671671
}
672672
}

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

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

2222
//MARK: Helper Methods for Updating Dirty Path
23-
internal func getUpdatedIntSummary(property: MetatypeWrapper<Int, Int>) -> Int {
23+
internal func updatedIntSummary(property: MetatypeWrapper<Int, Int>) -> Int {
2424
// Collect information from state
2525
let updateInfo = state.withLock { state in
2626
state.getIntSummaryUpdateInfo(property: property)
2727
}
2828

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

3434
// Consolidate updated values
@@ -37,15 +37,15 @@ extension ProgressManager {
3737
}
3838
}
3939

40-
internal func getUpdatedUInt64Summary(property: MetatypeWrapper<UInt64, UInt64>) -> UInt64 {
40+
internal func updatedUInt64Summary(property: MetatypeWrapper<UInt64, UInt64>) -> UInt64 {
4141
// Collect information from state
4242
let updateInfo = state.withLock { state in
4343
state.getUInt64SummaryUpdateInfo(property: property)
4444
}
4545

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

5151
// Consolidate updated values
@@ -54,15 +54,15 @@ extension ProgressManager {
5454
}
5555
}
5656

57-
internal func getUpdatedDoubleSummary(property: MetatypeWrapper<Double, Double>) -> Double {
57+
internal func updatedDoubleSummary(property: MetatypeWrapper<Double, Double>) -> Double {
5858
// Collect information from state
5959
let updateInfo = state.withLock { state in
6060
state.getDoubleSummaryUpdateInfo(property: property)
6161
}
6262

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

6868
// Consolidate updated values
@@ -71,15 +71,15 @@ extension ProgressManager {
7171
}
7272
}
7373

74-
internal func getUpdatedStringSummary(property: MetatypeWrapper<String?, [String?]>) -> [String?] {
74+
internal func updatedStringSummary(property: MetatypeWrapper<String?, [String?]>) -> [String?] {
7575
// Collect information from state
7676
let updateInfo = state.withLock { state in
7777
state.getStringSummaryUpdateInfo(property: property)
7878
}
7979

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

8585
// Consolidate updated values
@@ -88,15 +88,15 @@ extension ProgressManager {
8888
}
8989
}
9090

91-
internal func getUpdatedURLSummary(property: MetatypeWrapper<URL?, [URL?]>) -> [URL?] {
91+
internal func updatedURLSummary(property: MetatypeWrapper<URL?, [URL?]>) -> [URL?] {
9292
// Collect information from state
9393
let updateInfo = state.withLock { state in
9494
state.getURLSummaryUpdateInfo(property: property)
9595
}
9696

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

102102
// Consolidate updated values
@@ -105,15 +105,15 @@ extension ProgressManager {
105105
}
106106
}
107107

108-
internal func getUpdatedUInt64ArraySummary(property: MetatypeWrapper<UInt64, [UInt64]>) -> [UInt64] {
108+
internal func updatedUInt64ArraySummary(property: MetatypeWrapper<UInt64, [UInt64]>) -> [UInt64] {
109109
// Collect information from state
110110
let updateInfo = state.withLock { state in
111111
state.getUInt64ArraySummaryUpdateInfo(property: property)
112112
}
113113

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

119119
// Consolidate updated values
@@ -122,15 +122,15 @@ extension ProgressManager {
122122
}
123123
}
124124

125-
internal func getUpdatedDurationSummary(property: MetatypeWrapper<Duration, Duration>) -> Duration {
125+
internal func updatedDurationSummary(property: MetatypeWrapper<Duration, Duration>) -> Duration {
126126
// Collect information from state
127127
let updateInfo = state.withLock { state in
128128
state.getDurationSummaryUpdateInfo(property: property)
129129
}
130130

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

136136
// Consolidate updated values
@@ -139,15 +139,15 @@ extension ProgressManager {
139139
}
140140
}
141141

142-
internal func getUpdatedFileCount(type: CountType) -> Int {
142+
internal func updatedFileCount(type: CountType) -> Int {
143143
// Collect information from state
144144
let updateInfo = state.withLock { state in
145145
state.getFileCountUpdateInfo(type: type)
146146
}
147147

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

153153
// Consolidate updated values
@@ -156,15 +156,15 @@ extension ProgressManager {
156156
}
157157
}
158158

159-
internal func getUpdatedByteCount(type: CountType) -> UInt64 {
159+
internal func updatedByteCount(type: CountType) -> UInt64 {
160160
// Collect information from state
161161
let updateInfo = state.withLock { state in
162162
state.getByteCountUpdateInfo(type: type)
163163
}
164164

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

170170
// Consolidate updated values
@@ -173,32 +173,32 @@ extension ProgressManager {
173173
}
174174
}
175175

176-
internal func getUpdatedThroughput() -> [UInt64] {
176+
internal func updatedThroughput() -> [UInt64] {
177177
// Collect information from state
178178
let updateInfo = state.withLock { state in
179179
state.getThroughputUpdateInfo()
180180
}
181181

182182
// Get updated summary for each dirty child
183183
let updatedSummaries = updateInfo.dirtyChildren.map { (index, child) in
184-
State.ThroughputUpdate(index: index, updatedSummary: child.getUpdatedThroughput())
184+
State.ThroughputUpdate(index: index, updatedSummary: child.updatedThroughput())
185185
}
186186

187187
// Consolidate updated values
188188
return state.withLock { state in
189-
state.getUpdatedThroughput(updateInfo, updatedSummaries)
189+
state.updatedThroughput(updateInfo, updatedSummaries)
190190
}
191191
}
192192

193-
internal func getUpdatedEstimatedTimeRemaining() -> Duration {
193+
internal func updatedEstimatedTimeRemaining() -> Duration {
194194
// Collect information from state
195195
let updateInfo = state.withLock { state in
196196
state.getEstimatedTimeRemainingUpdateInfo()
197197
}
198198

199199
// Get updated summary for each dirty child
200200
let updatedSummaries = updateInfo.dirtyChildren.map { (index, child) in
201-
State.EstimatedTimeRemainingUpdate(index: index, updatedSummary: child.getUpdatedEstimatedTimeRemaining())
201+
State.EstimatedTimeRemainingUpdate(index: index, updatedSummary: child.updatedEstimatedTimeRemaining())
202202
}
203203

204204
// Consolidate updated values

Sources/FoundationEssentials/ProgressManager/ProgressManager+State.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ extension ProgressManager {
197197
for (idx, childState) in children.enumerated() {
198198
if childState.isDirty {
199199
if let child = childState.child {
200-
let updatedProgressFraction = child.getUpdatedProgressFraction()
200+
let updatedProgressFraction = child.updatedProgressFraction()
201201
let wasFinished = children[idx].childFraction.isFinished
202202
children[idx].childFraction = updatedProgressFraction
203203
// Only add to selfFraction if transitioning from unfinished to finished
@@ -1138,7 +1138,7 @@ extension ProgressManager {
11381138
)
11391139
}
11401140

1141-
internal mutating func getUpdatedThroughput(_ updateInfo: ThroughputUpdateInfo, _ childUpdates: [ThroughputUpdate]) -> [UInt64] {
1141+
internal mutating func updatedThroughput(_ updateInfo: ThroughputUpdateInfo, _ childUpdates: [ThroughputUpdate]) -> [UInt64] {
11421142
var value = updateInfo.currentSummary
11431143

11441144
// Apply updates from children that were dirty

Sources/FoundationEssentials/ProgressManager/ProgressManager.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ internal import _FoundationCollections
240240
}
241241
}
242242

243-
internal func getUpdatedProgressFraction() -> ProgressFraction {
243+
internal func updatedProgressFraction() -> ProgressFraction {
244244
return state.withLock { state in
245245
state.updateChildrenProgressFraction()
246246
return state.overallFraction
@@ -323,52 +323,52 @@ internal import _FoundationCollections
323323

324324
var finalSummaryInt: [MetatypeWrapper<Int, Int>: Int] = [:]
325325
for property in propertiesInt.keys {
326-
let updatedSummary = self.getUpdatedIntSummary(property: property)
326+
let updatedSummary = self.updatedIntSummary(property: property)
327327
finalSummaryInt[property] = updatedSummary
328328
}
329329

330330
var finalSummaryUInt64: [MetatypeWrapper<UInt64, UInt64>: UInt64] = [:]
331331
for property in propertiesUInt64.keys {
332-
let updatedSummary = self.getUpdatedUInt64Summary(property: property)
332+
let updatedSummary = self.updatedUInt64Summary(property: property)
333333
finalSummaryUInt64[property] = updatedSummary
334334
}
335335

336336
var finalSummaryDouble: [MetatypeWrapper<Double, Double>: Double] = [:]
337337
for property in propertiesDouble.keys {
338-
let updatedSummary = self.getUpdatedDoubleSummary(property: property)
338+
let updatedSummary = self.updatedDoubleSummary(property: property)
339339
finalSummaryDouble[property] = updatedSummary
340340
}
341341

342342
var finalSummaryString: [MetatypeWrapper<String?, [String?]>: [String?]] = [:]
343343
for property in propertiesString.keys {
344-
let updatedSummary = self.getUpdatedStringSummary(property: property)
344+
let updatedSummary = self.updatedStringSummary(property: property)
345345
finalSummaryString[property] = updatedSummary
346346
}
347347

348348
var finalSummaryURL: [MetatypeWrapper<URL?, [URL?]>: [URL?]] = [:]
349349
for property in propertiesURL.keys {
350-
let updatedSummary = self.getUpdatedURLSummary(property: property)
350+
let updatedSummary = self.updatedURLSummary(property: property)
351351
finalSummaryURL[property] = updatedSummary
352352
}
353353

354354
var finalSummaryUInt64Array: [MetatypeWrapper<UInt64, [UInt64]>: [UInt64]] = [:]
355355
for property in propertiesUInt64Array.keys {
356-
let updatedSummary = self.getUpdatedUInt64ArraySummary(property: property)
356+
let updatedSummary = self.updatedUInt64ArraySummary(property: property)
357357
finalSummaryUInt64Array[property] = updatedSummary
358358
}
359359

360360
var finalSummaryDuration: [MetatypeWrapper<Duration, Duration>: Duration] = [:]
361361
for property in propertiesDuration.keys {
362-
let updatedSummary = self.getUpdatedDurationSummary(property: property)
362+
let updatedSummary = self.updatedDurationSummary(property: property)
363363
finalSummaryDuration[property] = updatedSummary
364364
}
365365

366-
let totalFileCount = self.getUpdatedFileCount(type: .total)
367-
let completedFileCount = self.getUpdatedFileCount(type: .completed)
368-
let totalByteCount = self.getUpdatedByteCount(type: .total)
369-
let completedByteCount = self.getUpdatedByteCount(type: .completed)
370-
let throughput = self.getUpdatedThroughput()
371-
let estimatedTimeRemaining = self.getUpdatedEstimatedTimeRemaining()
366+
let totalFileCount = self.updatedFileCount(type: .total)
367+
let completedFileCount = self.updatedFileCount(type: .completed)
368+
let totalByteCount = self.updatedByteCount(type: .total)
369+
let completedByteCount = self.updatedByteCount(type: .completed)
370+
let throughput = self.updatedThroughput()
371+
let estimatedTimeRemaining = self.updatedEstimatedTimeRemaining()
372372

373373
if !isFinished {
374374
markSelfDirty(parents: parents)

0 commit comments

Comments
 (0)