koolhazz / stringencoders

Automatically exported from code.google.com/p/stringencoders
Other
0 stars 0 forks source link

Possible optimization for numbers < 10 #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Nick, while you're in there... I was thinking there might be another 
optimization for numbers that are less than 10. For these, we know the length 
of the string up front (precision + 2). In this case, can't we avoid the need 
to reverse the string at the end?

Also, to make it easier to use the result, it would be nice to have the return 
value be the # of chars written. Saves a strlen.

Original issue reported on code.google.com by bokel...@gmail.com on 30 Dec 2010 at 7:27

GoogleCodeExporter commented 9 years ago
re: it would be nice to have the return value be the # of chars written

Agreed.

I'll take a peek at the optimzation.

Original comment by nickgsup...@gmail.com on 3 Jan 2011 at 1:27

GoogleCodeExporter commented 9 years ago

Original comment by nickgsup...@gmail.com on 13 Aug 2012 at 11:18