File tree Expand file tree Collapse file tree 1 file changed +16
-18
lines changed
Sources/ComposableArchitecture/Internal Expand file tree Collapse file tree 1 file changed +16
-18
lines changed Original file line number Diff line number Diff line change 1- #if compiler(<6.2)
2- import Dispatch
1+ import Dispatch
32
4- func mainActorNow< R: Sendable > ( execute block: @MainActor @Sendable ( ) -> R ) -> R {
5- if DispatchQueue . getSpecific ( key: key) == value {
6- return MainActor . _assumeIsolated {
3+ func mainActorNow< R: Sendable > ( execute block: @MainActor @Sendable ( ) -> R ) -> R {
4+ if DispatchQueue . getSpecific ( key: key) == value {
5+ return MainActor . _assumeIsolated {
6+ block ( )
7+ }
8+ } else {
9+ return DispatchQueue . main. sync {
10+ MainActor . _assumeIsolated {
711 block ( )
812 }
9- } else {
10- return DispatchQueue . main. sync {
11- MainActor . _assumeIsolated {
12- block ( )
13- }
14- }
1513 }
1614 }
15+ }
1716
18- private let key : DispatchSpecificKey < UInt8 > = {
19- let key = DispatchSpecificKey < UInt8 > ( )
20- DispatchQueue . main. setSpecific ( key: key, value: value)
21- return key
22- } ( )
23- private let value : UInt8 = 0
24- #endif
17+ private let key : DispatchSpecificKey < UInt8 > = {
18+ let key = DispatchSpecificKey < UInt8 > ( )
19+ DispatchQueue . main. setSpecific ( key: key, value: value)
20+ return key
21+ } ( )
22+ private let value : UInt8 = 0
You can’t perform that action at this time.
0 commit comments