Jump to content

Is this a good place to use the "swap value" primitive?

Recommended Posts

Is it ever conceivable that there will be more than two Queues to monitor?  If so then the last one would scale up better.  That being said it isn't the one I'd find myself using, just because the other two are much more readable.  I'd probably go with the first one.  Swap values is pretty handy when you actually need to swap two values.  Here you aren't really using one of the values.  From a memory or speed perspective I bet you can't measure the small amount of difference (if any) that is taking place.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.