Switch statement can be replaced with enhanced 'switch'.

This commit is contained in:
Len 2026-07-24 11:14:35 -05:00
parent 9fe2630f42
commit f5ae50ec34

View File

@ -16,19 +16,13 @@ public class BarUtils
*/
public static BarStyle parseBarStyle(int style)
{
switch (style)
{
case 6:
return BarStyle.SEGMENTED_6;
case 10:
return BarStyle.SEGMENTED_10;
case 12:
return BarStyle.SEGMENTED_12;
case 20:
return BarStyle.SEGMENTED_20;
default:
return BarStyle.SOLID;
}
return switch (style) {
case 6 -> BarStyle.SEGMENTED_6;
case 10 -> BarStyle.SEGMENTED_10;
case 12 -> BarStyle.SEGMENTED_12;
case 20 -> BarStyle.SEGMENTED_20;
default -> BarStyle.SOLID;
};
}
/**