Skip to content

Commit 755657a

Browse files
slightly optimize column count
1 parent aa5fa35 commit 755657a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/Etterna/Globals/MinaCalc/SequencingHelpers.h

+15-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,22 @@ static const float finalscaler = 3.632F;
1818
static const int max_rows_for_single_interval = 50;
1919

2020
inline auto
21-
column_count(const int& notes) -> unsigned int
21+
column_count(const unsigned& notes) -> int
2222
{
23-
return notes % 2 + notes / 2 % 2 + notes / 4 % 2 + notes / 8 % 2;
23+
// singles
24+
if (notes == 1U || notes == 2U || notes == 4U || notes == 8U)
25+
return 1;
26+
27+
// hands
28+
if (notes == 7U || notes == 11U || notes == 13U || notes == 14U)
29+
return 3;
30+
31+
// quad
32+
if (notes == 15U)
33+
return 4;
34+
35+
// everything else is a jump
36+
return 2;
2437
}
2538

2639
inline auto

0 commit comments

Comments
 (0)