in reply to Re: swapping vars, two ways, 2 results... in thread swapping vars, two ways, 2 results...
well it does use less memory, but that may be due to the length of the vars...
Anyway, this was a kinda stupid post but I wanted to write it cause I saw in one of my team mates code that he would never swap perls way, but rather Cs way, using a temp var. I first thought why wrinting it Cs way when you can use a more compact form. But then I saw that in some case it was actually totally different both in terms of cpu usage and mem, hence the post.
|