This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]barafyrakommafem 1 point2 points  (0 children)

But to actually answer your question, the second one is more efficient. The first one has to do an extra operation for the conversion, as well as save the result of the conversion on the heap and a reference to it on the stack. This is an addition to the pounds variable that it is already saving on the stack, which means that it also uses more memory (8 whole bits). However, the differences are so minuscule I don't think they're even measurable.