Skip to content

Commit 0f69a06

Browse files
committed
Improve #33 using 'var lazy' in LazyCollectionType.
1 parent a26af2c commit 0f69a06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SwiftState/StateMachine.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public class StateMachine<S: StateType, E: StateEventType>
166166
var transitionDicts: [TransitionRouteDictionary] = []
167167

168168
if event == nil as Event {
169-
transitionDicts += [TransitionRouteDictionary](self._routes.values)
169+
transitionDicts += self._routes.values.lazy
170170
}
171171
else {
172172
for (ev, transitionDict) in self._routes {
@@ -303,7 +303,7 @@ public class StateMachine<S: StateType, E: StateEventType>
303303
{
304304
var validEvents: [Event] = []
305305
if event == nil as Event {
306-
validEvents += [Event](self._routes.keys)
306+
validEvents += self._routes.keys.lazy
307307
}
308308
else {
309309
validEvents += [event]

0 commit comments

Comments
 (0)