Version Used: features/recursive-patterns
Steps to Reproduce:
These two methods produce the same result but since the second one is already sorted by most common patterns, it generates significantly better code.
public static bool M1(int i, int j, int k) {
switch(i, j, k) {
case (0, 1, 3):
case (1, 1, 3):
return true;
default:
return false;
}
}
public static bool M2(int i, int j, int k) {
switch(k, j, i) {
case (3, 1, 0):
case (3, 1, 1):
return true;
default:
return false;
}
}
Expected Behavior:
The generated code should match the most common patterns first, no matter what order they appear in the source.
Actual Behavior:
The generated code reflects the order in which patterns are appeared in the source.
Version Used:
features/recursive-patternsSteps to Reproduce:
These two methods produce the same result but since the second one is already sorted by most common patterns, it generates significantly better code.
Expected Behavior:
The generated code should match the most common patterns first, no matter what order they appear in the source.
Actual Behavior:
The generated code reflects the order in which patterns are appeared in the source.