Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
6
Reply
Multiple assignment vs object creation
time and space
Jul 5 2011 3:02 PM
1.7k
Reply
Which would be faster?
oldPosition =
new
Vector2(position.X, position.Y);
OR
oldPosition.X = position.X;
oldPosition.Y = position.Y;
I'm assuming the second example is more efficient since a new object isn't being created, unless the compiler automatically optimises such things?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
6
)
Next Recommended Forum
XNA 2D game help please
How to assign TimeSpan with a default value when using it as an argument?