File tree Expand file tree Collapse file tree 1 file changed +24
-14
lines changed
Sources/GateEngine/ECS/Base Expand file tree Collapse file tree 1 file changed +24
-14
lines changed Original file line number Diff line number Diff line change 131131 let rhs = type ( of: rhs)
132132 let lhsSO = lhs. sortOrder ( ) ? . rawValue
133133 let rhsSO = rhs. sortOrder ( ) ? . rawValue
134- if lhsSO != nil || rhsSO != nil {
135- if let lhsSO = lhsSO, let rhsSO = rhsSO {
136- return lhsSO < rhsSO
137- }
138- if lhsSO != nil {
139- return true
140- }
141- if rhsSO != nil {
142- return true
143- }
134+
135+ if let lhsSO = lhsSO, let rhsSO = rhsSO {
136+ return lhsSO < rhsSO
137+ }
138+ if let lhsSO {
139+ return lhsSO <= 0
144140 }
141+ if let rhsSO {
142+ return rhsSO > 0
143+ }
144+
145145 return false
146146 } )
147147 }
165165 _systems. sort ( by: { ( lhs, rhs) -> Bool in
166166 let lhsSO = type ( of: lhs) . sortOrder ( ) ? . rawValue
167167 let rhsSO = type ( of: rhs) . sortOrder ( ) ? . rawValue
168+
168169 if let lhsSO = lhsSO, let rhsSO = rhsSO {
169170 return lhsSO < rhsSO
170171 }
171- if lhsSO == nil && rhsSO != nil {
172- return true
172+ if let lhsSO {
173+ return lhsSO <= 0
174+ }
175+ if let rhsSO {
176+ return rhsSO > 0
173177 }
178+
174179 return false
175180 } )
176181 }
189194 _renderingSystems. sort ( by: { ( lhs, rhs) -> Bool in
190195 let lhsSO = type ( of: lhs) . sortOrder ( ) ? . rawValue
191196 let rhsSO = type ( of: rhs) . sortOrder ( ) ? . rawValue
197+
192198 if let lhsSO = lhsSO, let rhsSO = rhsSO {
193199 return lhsSO < rhsSO
194200 }
195- if lhsSO == nil && rhsSO != nil {
196- return true
201+ if let lhsSO {
202+ return lhsSO <= 0
203+ }
204+ if let rhsSO {
205+ return rhsSO > 0
197206 }
207+
198208 return false
199209 } )
200210 }
You can’t perform that action at this time.
0 commit comments