Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RegionHandler.java #2295

Merged
merged 1 commit into from
Aug 20, 2023

Conversation

CerisWhite
Copy link
Contributor

Description

This is a small gripe, and you're free to reject this of course, but it seems pointless to regex the string purely to remove the version code when substring is more than sufficient. This also allows all three platform names to be 8 characters even.

Who decided to regex it like that???
@Catta1997
Copy link
Contributor

I think that regex is better since you do not know how long version number is

@CerisWhite
Copy link
Contributor Author

This particular use of regex is to remove only the version code (e.g. "3.7") from the string, in order to get the client type (e.g. "OSRELWin", "OSRELiOS", etc), so the length of the actual version code has no bearing. We only need the first 8 characters to identify the client, and regex on the entire string to remove only the version code is more intensive than just taking the first 8 characters.

@KingRainbow44 KingRainbow44 merged commit 2b0f2f7 into Grasscutters:development Aug 20, 2023
2 checks passed
Simplxss pushed a commit to Simplxss/Grasscutter that referenced this pull request Aug 21, 2023
Who decided to regex it like that???
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.

3 participants