Shallot icon indicating copy to clipboard operation
Shallot copied to clipboard

Getting rid of int_pow.

Open ChrisCalderon opened this issue 10 years ago • 0 comments

I was browsing the source when I noticed int_pow. First, I didn't like that it uses the simple linear algorithm. Second, it is only used twice, in the thread file, and for computing powers of two. Why write a function to multiply a number by 2, n time, in a loop, when you could do a simple bitshift and assignment?

ChrisCalderon avatar Nov 29 '13 08:11 ChrisCalderon