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

Add pragma warning #2202

Merged
merged 1 commit into from Sep 4, 2019

Conversation

@yahiheb
Copy link
Collaborator

commented Sep 1, 2019

If this is ugly I can surround the Tables and Node classes with the pragma warning.

@nopara73
Copy link
Collaborator

left a comment

Is it possible to make them private and rename _fobarbuz instead?

@yahiheb

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 2, 2019

I tried to make them private here #2175

@nopara73

This comment has been minimized.

Copy link
Collaborator

commented Sep 3, 2019

I tried to make them private here #2175

I meant without encapsulation, just simple private fields. Also it was a question, not an instruction, I truly don't know if anyone is consuming those fields or not, I suspect not, because they're in the concurrenthashset itself and I don't remember using them.

@yahiheb

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 3, 2019

just simple private fields

No they can't be private because they are used in ConcurrentHashSet class.

The other public readonly fields can be replaced with auto properties with getter only.
public readonly T Item; becomes public T Item { get; }

@molnard
molnard approved these changes Sep 4, 2019
Copy link
Collaborator

left a comment

The volatile keyword indicates that a field might be modified by multiple threads that are executing at the same time.
It has to be a field, encapsulation can violate the feature above.

@molnard molnard merged commit 894afe3 into zkSNACKs:master Sep 4, 2019

3 of 4 checks passed

Wasabi.Linux #20190901.10 failed
Details
CodeFactor No issues found.
Details
Wasabi.Osx #20190901.10 succeeded
Details
Wasabi.Windows #20190901.10 succeeded
Details

@yahiheb yahiheb deleted the yahiheb:pragma-warning branch Sep 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.