TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
time and space
1.7k
31
57.3k
Multiple assignment vs object creation
Jul 5 2011 3:02 PM
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?
Reply
Answers (
6
)
XNA 2D game help please
How to assign TimeSpan with a default value when using it as an argument?