refactored binary_to_hex to use binary comprehension #3

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

dnet commented Jun 19, 2011

it's been in the language since at least 2007, and makes the code more readable and faster (fewer recursions)

Contributor

dnet commented Jun 23, 2011

Is there a problem with this commit?

Owner

tonyg commented Jun 25, 2011

Have you measured the speedup? If it's big, I guess I could merge it; but if it's not big, I'd prefer to keep the backwards compatibility.

Contributor

dnet commented Jun 25, 2011

I did a very simple and primitive measurement with timer:tc but the speedup is not that big (27.4 vs. 27.77 msec), the change is more about readability. I also checked that binary comprehensions "became officital" in R12B released in december 2007, and your code doesn't use any features that appeared in later versions, so if backwards compatibility is a matter, I agree with you not merging it.

@dnet dnet closed this Jun 25, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment