Skip to content

Commit

Permalink
Remove Lock when reduce is executed
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryu0118 committed Oct 1, 2023
1 parent d495951 commit 152874e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Sources/SimplexArchitecture/Store/Store+send.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ extension Store {
// If Unit Testing is in progress and an action is sent from SideEffect
if _XCTIsTesting, let effectContext = EffectContext.id {
let before = container.copy()
sideEffect = withLock {
reduce(container, action)
}
sideEffect = reduce(container, action)
sentFromEffectActions.append(
ActionTransition(
previous: .init(state: before.states, reducerState: before._reducerState),
Expand All @@ -86,7 +84,7 @@ extension Store {
)
)
} else {
sideEffect = withLock { reduce(container, action) }
sideEffect = reduce(container, action)
}

if case .none = sideEffect.kind {
Expand Down

0 comments on commit 152874e

Please sign in to comment.