Skip to content

Commit eca4c4a

Browse files
committed
fix: remove unnecessary iteration
1 parent 134b9d0 commit eca4c4a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/src/create_reducer.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ class _ActionReducerMapBuilder<State>
5353
return _actionsMap[action.runtimeType];
5454
}
5555

56-
if (_actionMatchers.keys.any((matcher) => matcher(action))) {
57-
return _actionMatchers.entries
58-
.firstWhere((element) => element.key(action))
59-
.value;
56+
for (final entry in _actionMatchers.entries) {
57+
if (entry.key(action)) {
58+
return entry.value;
59+
}
6060
}
6161

6262
return _defaultCaseReducer;

0 commit comments

Comments
 (0)