Commit dd3b1fe
authored
refactor(objc): use if let Some in for-loop instead of ? (#1156)
The `?` operator inside a `for` loop short-circuits the entire enclosing
function on the first `None`, not just the current iteration. In practice
`node.child(i)` returns `Some` for every `i < child_count()`, so this is
harmless today, but `if let Some(child) = node.child(i)` is more
defensively correct and matches the pattern used in the rest of the
extractors after the Verilog sweep in #1155.
Closes #11161 parent d255297 commit dd3b1fe
1 file changed
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
503 | 504 | | |
504 | 505 | | |
505 | 506 | | |
| |||
0 commit comments