Commit 8bb43ac
committed
Dropped switch-case from lfs3_rbyd_appendrattr_
Now that lfs3_mtree_traverse_ uses a sort of state matrix,
lfs3_rbyd_appendrattr_ is the only function still relying on a big
switch-case statement. Replacing it with a series of if-else statements
leaves the codebase switch-case free (ignoring test/bench runners, etc).
Switch-case statements are extremely error prone in C, with the shared
scope, implicit fallthrough, etc. And, with today's compilers, the
result still ends up the same, so switch-case statements offer no
benefit except maybe a more enjoyable syntax for masochists.
Avoiding switch-case statements in code where we care about correctness
is probably a good idea.
No code changes1 parent e9f2944 commit 8bb43ac
1 file changed
+12
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3551 | 3551 | | |
3552 | 3552 | | |
3553 | 3553 | | |
3554 | | - | |
3555 | 3554 | | |
3556 | | - | |
| 3555 | + | |
3557 | 3556 | | |
3558 | 3557 | | |
3559 | 3558 | | |
3560 | | - | |
3561 | 3559 | | |
3562 | 3560 | | |
3563 | | - | |
| 3561 | + | |
3564 | 3562 | | |
3565 | 3563 | | |
3566 | | - | |
3567 | 3564 | | |
3568 | 3565 | | |
3569 | | - | |
| 3566 | + | |
3570 | 3567 | | |
3571 | 3568 | | |
3572 | 3569 | | |
3573 | 3570 | | |
3574 | | - | |
3575 | 3571 | | |
3576 | 3572 | | |
3577 | | - | |
| 3573 | + | |
3578 | 3574 | | |
3579 | 3575 | | |
3580 | 3576 | | |
| |||
3584 | 3580 | | |
3585 | 3581 | | |
3586 | 3582 | | |
3587 | | - | |
3588 | 3583 | | |
3589 | 3584 | | |
3590 | | - | |
| 3585 | + | |
3591 | 3586 | | |
3592 | 3587 | | |
3593 | 3588 | | |
3594 | 3589 | | |
3595 | 3590 | | |
3596 | | - | |
3597 | 3591 | | |
3598 | 3592 | | |
3599 | | - | |
| 3593 | + | |
3600 | 3594 | | |
3601 | 3595 | | |
3602 | 3596 | | |
3603 | 3597 | | |
3604 | | - | |
3605 | 3598 | | |
3606 | 3599 | | |
3607 | | - | |
| 3600 | + | |
3608 | 3601 | | |
3609 | 3602 | | |
3610 | 3603 | | |
3611 | 3604 | | |
3612 | | - | |
3613 | 3605 | | |
3614 | 3606 | | |
3615 | | - | |
| 3607 | + | |
3616 | 3608 | | |
3617 | 3609 | | |
3618 | 3610 | | |
3619 | 3611 | | |
3620 | | - | |
3621 | 3612 | | |
3622 | 3613 | | |
3623 | | - | |
| 3614 | + | |
3624 | 3615 | | |
3625 | 3616 | | |
3626 | 3617 | | |
3627 | 3618 | | |
3628 | 3619 | | |
3629 | 3620 | | |
3630 | 3621 | | |
3631 | | - | |
3632 | 3622 | | |
3633 | 3623 | | |
3634 | | - | |
| 3624 | + | |
3635 | 3625 | | |
3636 | 3626 | | |
3637 | 3627 | | |
3638 | 3628 | | |
3639 | | - | |
3640 | 3629 | | |
3641 | 3630 | | |
3642 | | - | |
| 3631 | + | |
3643 | 3632 | | |
3644 | 3633 | | |
3645 | 3634 | | |
3646 | 3635 | | |
3647 | | - | |
3648 | 3636 | | |
3649 | | - | |
| 3637 | + | |
3650 | 3638 | | |
3651 | 3639 | | |
3652 | 3640 | | |
| |||
0 commit comments