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

Minor cleanups and optimizations #1746

Merged
merged 1 commit into from Dec 2, 2023
Merged

Conversation

turbedi
Copy link
Contributor

@turbedi turbedi commented Dec 1, 2023

  • replace byte.Parse(string.Substring()) calls with byte.Parse(string.AsSpan())
  • use static MD5.HashData instead of creating a MD5 instance
  • use Convert.ToHexString() instead of BitConverter.ToString(hash).Replace("-", "")
  • Remove unnecessary array allocation in a string.Trim() call
  • use Random.Shared and Random.NextSingle()

- replace byte.Parse(string.Substring()) calls with byte.Parse(string.AsSpan())
- use static MD5.HashData instead of creating a MD5 instance
- use Convert.ToHexString() instead of BitConverter.ToString(hash).Replace("-", "")
- Remove unnecessary array allocation in a string.Trim() call
- use Random.Shared and Random.NextSingle()
@d2phap d2phap merged commit a6e640b into d2phap:develop Dec 2, 2023
@turbedi turbedi deleted the minor_cleanup branch December 2, 2023 16:04
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.

None yet

2 participants