Imagine I have a Point struct with X and Y coordinate.
Now i have constructor: Point (int x, int y).
Question: Should I also add method called Point.SetXY (int x, int y)?
example:
// I have some point
point = new Point (5,5);
// and I wanna change some values
point = new Point (7,7);
// or maybe should I do like this?
point.SetXY (7,7); // is it faster?
For classes i know it is faster because u dont need to create new instance on heap etc.
But maybe for structs it doesnt matter?
Ithink you can achieve it by
This is fastest