-
Notifications
You must be signed in to change notification settings - Fork 30
Update memory.js to memory.cs #13
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
base: main
Are you sure you want to change the base?
Conversation
Why were all the changes added to the js file? it would be better to make CSharp folder? |
private int x; | ||
private int y; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is better to have private fields with underscore _
prefix
public Point(int _x, int _y) | ||
{ | ||
x = _x; | ||
y = _y; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While constructor parameters without underscore
public Point(int _x, int _y) | |
{ | |
x = _x; | |
y = _y; | |
} | |
public Point(int x, int y) | |
{ | |
_x = x; | |
_y = y; | |
} |
int currentX = Interlocked.CompareExchange(ref x, 0, 0); | ||
int currentY = Interlocked.CompareExchange(ref y, 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Volatile.Read for read (load)
int currentX = Interlocked.CompareExchange(ref x, 0, 0); | ||
int currentY = Interlocked.CompareExchange(ref y, 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
No description provided.