Commit f908e75
committed
Fix #2903: Reduce the depth of trees generated in PatternMatcher
* Extract all match arguments before checking conditions on them like scalac does.
This avoids an extra nested block for each match variable.
* Merge conditions of nested `if` expressions if their `else` branch is the same.
This optimization combined with the previous removes most of the nested `if`s
created to check the matched args.1 parent 140faba commit f908e75
1 file changed
+3
-3
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
846 | 846 | | |
847 | 847 | | |
848 | 848 | | |
849 | | - | |
| 849 | + | |
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
853 | | - | |
| 853 | + | |
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
| |||
862 | 862 | | |
863 | 863 | | |
864 | 864 | | |
865 | | - | |
| 865 | + | |
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
| |||
0 commit comments