Commit e81d275
🧹 Remove dead code in _enumFieldsMap (#194)
Refactor `_enumFieldsMap` and `enumValueMapFromType` in `build_cli/lib/src/enum_helpers.dart` to eliminate an unreachable `return null` and redundant null checks.
- Changed `_enumFieldsMap` to return `Map<FieldElement, String>` (non-nullable) and use an explicit cast to `EnumElement` for the target type's element, as it's only called for enums.
- Updated `enumValueMapFromType` to return `String` (non-nullable) and removed the now unnecessary null check.
- Cleaned up the call site in `build_cli/lib/src/build_cli_generator.dart` to remove a redundant bang operator.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 0e03dad commit e81d275
2 files changed
Lines changed: 8 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 10 | | |
15 | 11 | | |
16 | 12 | | |
| |||
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
37 | 26 | | |
38 | 27 | | |
39 | 28 | | |
| |||
0 commit comments