refactored binary_to_hex to use binary comprehension #3

wants to merge 1 commit into


None yet
2 participants

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)


dnet commented Jun 23, 2011

Is there a problem with this commit?


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.


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