Skip to content

Commit b46b6eb

Browse files
Remove guard assertions (#421)
1 parent d98895c commit b46b6eb

File tree

3 files changed

+6
-24
lines changed

3 files changed

+6
-24
lines changed

Sources/Nodes/Classes/AbstractContext.swift

+2-8
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@ open class AbstractContext<CancellableType: Cancellable>: Context {
101101
/// This method is called internally within the framework code.
102102
public final func activate() {
103103
guard !isActive
104-
else {
105-
assertionFailure("Unable to activate")
106-
return
107-
}
104+
else { return }
108105
isActive = true
109106
didBecomeActive()
110107
workerController.startWorkers()
@@ -116,10 +113,7 @@ open class AbstractContext<CancellableType: Cancellable>: Context {
116113
/// This method is called internally within the framework code.
117114
public final func deactivate() {
118115
guard isActive
119-
else {
120-
assertionFailure("Unable to deactivate")
121-
return
122-
}
116+
else { return }
123117
workerController.stopWorkers()
124118
willResignActive()
125119
cancellables.forEach { cancellable in

Sources/Nodes/Classes/AbstractFlow.swift

+2-8
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,7 @@ open class AbstractFlow<ContextInterfaceType, ViewControllerType>: Flow {
142142
/// This method is called internally within the framework code.
143143
public final func start() {
144144
guard !isStarted
145-
else {
146-
assertionFailure("Unable to start")
147-
return
148-
}
145+
else { return }
149146
#if DEBUG
150147
DebugInformation.FlowWillStartNotification(flow: self, viewController: viewController as AnyObject).post()
151148
#endif
@@ -159,10 +156,7 @@ open class AbstractFlow<ContextInterfaceType, ViewControllerType>: Flow {
159156
/// This method is called internally within the framework code.
160157
public final func end() {
161158
guard isStarted
162-
else {
163-
assertionFailure("Unable to end")
164-
return
165-
}
159+
else { return }
166160
_context.deactivate()
167161
#if DEBUG
168162
DebugInformation.FlowDidEndNotification(flow: self).post()

Sources/Nodes/Classes/AbstractWorker.swift

+2-8
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ open class AbstractWorker<CancellableType: Cancellable>: Worker {
6868
/// This method is called internally within the framework code.
6969
public final func start() {
7070
guard !isWorking
71-
else {
72-
assertionFailure("Unable to start")
73-
return
74-
}
71+
else { return }
7572
isWorking = true
7673
didStart()
7774
}
@@ -82,10 +79,7 @@ open class AbstractWorker<CancellableType: Cancellable>: Worker {
8279
/// This method is called internally within the framework code.
8380
public final func stop() {
8481
guard isWorking
85-
else {
86-
assertionFailure("Unable to stop")
87-
return
88-
}
82+
else { return }
8983
willStop()
9084
cancellables.forEach { cancellable in
9185
cancellable.cancel()

0 commit comments

Comments
 (0)