Skip to content

Fix a minor issue in StrumLine#958

Open
HEIHUAa wants to merge 2 commits intoCodenameCrew:mainfrom
HEIHUAa:StrumLine
Open

Fix a minor issue in StrumLine#958
HEIHUAa wants to merge 2 commits intoCodenameCrew:mainfrom
HEIHUAa:StrumLine

Conversation

@HEIHUAa
Copy link
Copy Markdown
Contributor

@HEIHUAa HEIHUAa commented Apr 9, 2026

Previously, using str.ID to read the state might have been inconsistent with the input from the code above:

for (i in 0...membersLength) {
    __pressed[i] = members[i].__getPressed(this);
    __justPressed[i] = members[i].__getJustPressed(this);
    __justReleased[i] = members[i].__getJustReleased(this);
}

It has now been unified to use the members index. Additionally, the new approach may offer better performance.

@HEIHUAa
Copy link
Copy Markdown
Contributor Author

HEIHUAa commented Apr 22, 2026

Added an extra optimization: due to the frequent calls to strumID, the modulus operation for each call has been eliminated. Using an if condition is much faster than %.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant