swap of two variables using temporary variable execute first or without using temporary variable execute first?
kanagamani
0
Newbie Poster
Recommended Answers
Jump to PostAt that granularity, everything is efficient. However, tricks for swapping without a temporary variable have a higher chance of not being as efficient due to potentially confusing the compiler's optimizer.
The lesson to be learned is that it's not worth trying to optimize a few bytes from a single scalar …
Jump to PostUse the regular swap, it makes your code simpler to maintain by others.
All 6 Replies
Assembly Guy
72
Posting Whiz
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
kanagamani
0
Newbie Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.