Skip to content

Conversation

ekaterynah
Copy link

No description provided.

@tshemsedinov
Copy link
Member

Why were all the changes added to the js file? it would be better to make CSharp folder?

Comment on lines +6 to +7
private int x;
private int y;
Copy link
Member

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

Comment on lines +9 to +13
public Point(int _x, int _y)
{
x = _x;
y = _y;
}
Copy link
Member

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

Suggested change
public Point(int _x, int _y)
{
x = _x;
y = _y;
}
public Point(int x, int y)
{
_x = x;
_y = y;
}

Comment on lines +25 to +26
int currentX = Interlocked.CompareExchange(ref x, 0, 0);
int currentY = Interlocked.CompareExchange(ref y, 0, 0);
Copy link
Member

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)

Comment on lines +33 to +34
int currentX = Interlocked.CompareExchange(ref x, 0, 0);
int currentY = Interlocked.CompareExchange(ref y, 0, 0);
Copy link
Member

Choose a reason for hiding this comment

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

ditto

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.

2 participants