Commit a3b4be0
authored
refactor(emulator): eliminate DRY violation in handleWriteMultipleRegisters (#322)
Eliminates DRY (Don't Repeat Yourself) violation in the handleWriteMultipleRegisters function by consolidating duplicated loop logic.
Changes:
- Consolidate two separate loops into a single loop that always collects values
- Move conditional logging after value collection
- Maintains 100% test coverage
- No functional changes to behavior
Technical Details:
- Before: Two separate loops - one collecting values for logging, one without
- After: Single loop always collects values, conditional logging after
- Performance impact is negligible (array creation < 1μs), prioritizing code maintainability
Test Results:
- All 331 emulator unit tests pass
- 100% coverage maintained on function-codes.ts1 parent b928c88 commit a3b4be0
1 file changed
Lines changed: 8 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
173 | 181 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 182 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | 183 | | |
187 | 184 | | |
188 | 185 | | |
| |||
0 commit comments