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

Change static to const #461

Merged
merged 3 commits into from
Jul 26, 2019
Merged

Change static to const #461

merged 3 commits into from
Jul 26, 2019

Conversation

originalfoo
Copy link
Member

Quoting @dymanoid :

It's better to use const string instead of static readonly string.
... const string is a cheaper and faster version of static readonly string.
It's not much about performance, but rather about semantics. You probably should not change everything to const, but the values that are real constants should be const. Read e.g. here. The version number could be static readonly because it changes from version to version and could be used by external assemblies, but the "LABS" string is a constant in the whole TMPE universe, so use const for that.

As per Dymanoid's advice, `const` is faster.
Noticed this while testing previous commit
@originalfoo originalfoo added the code cleanup Refactor code, remove old code, improve maintainability label Jul 26, 2019
@originalfoo originalfoo added this to the 11.0 milestone Jul 26, 2019
@originalfoo originalfoo self-assigned this Jul 26, 2019
@originalfoo originalfoo marked this pull request as ready for review July 26, 2019 20:21
originalfoo referenced this pull request Jul 26, 2019
Improve mod naming consistency and show version of TM:PE instance that's doing the checking.
@krzychu124 krzychu124 self-requested a review July 26, 2019 22:47
Copy link
Member

@krzychu124 krzychu124 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@originalfoo originalfoo merged commit 39e0240 into master Jul 26, 2019
@originalfoo originalfoo deleted the static-to-const branch July 26, 2019 23:04
@originalfoo originalfoo restored the static-to-const branch July 26, 2019 23:38
@originalfoo originalfoo deleted the static-to-const branch July 26, 2019 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup Refactor code, remove old code, improve maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants