Skip to content

Commit 574fdd2

Browse files
dfeinzimernjarecha
andcommitted
CR: Nimesh
Co-Authored-By: Nimesh Jarecha <4164028+njarecha@users.noreply.github.com>
1 parent 326f87f commit 574fdd2

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

Examples/Examples/FeatureFormExampleView.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,17 @@ extension FeatureFormExampleView {
107107
if database.serviceInfo?.canUseServiceGeodatabaseApplyEdits ?? false {
108108
let featureTableEditResults = try await database.applyEdits()
109109
let resultErrors = featureTableEditResults.flatMap(\.editResults.errors)
110-
if resultErrors.isEmpty {
111-
editedTables.removeAll { $0.serviceGeodatabase === database }
112-
} else {
110+
guard resultErrors.isEmpty else {
113111
throw makeSubmissionError(resultErrors)
114112
}
113+
editedTables.removeAll { $0.serviceGeodatabase === database }
115114
} else {
116115
let featureEditResults = try await table.applyEdits()
117116
let resultErrors = featureEditResults.errors
118-
if resultErrors.isEmpty {
119-
editedTables.removeAll { $0 === table }
120-
} else {
117+
guard resultErrors.isEmpty else {
121118
throw makeSubmissionError(resultErrors)
122119
}
120+
editedTables.removeAll { $0 === table }
123121
}
124122
} catch {
125123
throw .anyError(error)

Sources/ArcGISToolkit/Documentation.docc/Resources/FeatureFormView/FeatureFormViewTutorialSection1Step4.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,17 @@ extension FeatureFormExampleView {
7474
if database.serviceInfo?.canUseServiceGeodatabaseApplyEdits ?? false {
7575
let featureTableEditResults = try await database.applyEdits()
7676
let resultErrors = featureTableEditResults.flatMap(\.editResults.errors)
77-
if resultErrors.isEmpty {
78-
editedTables.removeAll { $0.serviceGeodatabase === database }
79-
} else {
77+
guard resultErrors.isEmpty else {
8078
throw makeSubmissionError(resultErrors)
8179
}
80+
editedTables.removeAll { $0.serviceGeodatabase === database }
8281
} else {
8382
let featureEditResults = try await table.applyEdits()
8483
let resultErrors = featureEditResults.errors
85-
if resultErrors.isEmpty {
86-
editedTables.removeAll { $0 === table }
87-
} else {
84+
guard resultErrors.isEmpty else {
8885
throw makeSubmissionError(resultErrors)
8986
}
87+
editedTables.removeAll { $0 === table }
9088
}
9189
} catch {
9290
throw .anyError(error)

Sources/ArcGISToolkit/Documentation.docc/Resources/FeatureFormView/FeatureFormViewTutorialSection1Step5.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,17 @@ extension FeatureFormExampleView {
8989
if database.serviceInfo?.canUseServiceGeodatabaseApplyEdits ?? false {
9090
let featureTableEditResults = try await database.applyEdits()
9191
let resultErrors = featureTableEditResults.flatMap(\.editResults.errors)
92-
if resultErrors.isEmpty {
93-
editedTables.removeAll { $0.serviceGeodatabase === database }
94-
} else {
92+
guard resultErrors.isEmpty else {
9593
throw makeSubmissionError(resultErrors)
9694
}
95+
editedTables.removeAll { $0.serviceGeodatabase === database }
9796
} else {
9897
let featureEditResults = try await table.applyEdits()
9998
let resultErrors = featureEditResults.errors
100-
if resultErrors.isEmpty {
101-
editedTables.removeAll { $0 === table }
102-
} else {
99+
guard resultErrors.isEmpty else {
103100
throw makeSubmissionError(resultErrors)
104101
}
102+
editedTables.removeAll { $0 === table }
105103
}
106104
} catch {
107105
throw .anyError(error)

0 commit comments

Comments
 (0)