Closed funny-falcon closed 13 years ago
Looks good. I'll see if I can test and merge this tomorrow, and put out a 1.0.2 gem. Thanks for the help!
Tests well except on JRuby, as the JRuby cext support doesn't include rb_cstr_to_dbl. I'll see if I can come up with a different implementation so it works on JRuby 1.6.0.
Well, initially atof
was there and worked well. I thought rb_cstr_to_dbl
would be more portable. It seems that I was mistaken :(
I went with atoi/pow, but probably should have used atof. Anyway, it appears to work. I also changed to the code to require at least one digit after the decimal, and support up to 9 digits.
atoi
were my first attempt :) well it would be a lesson for me - use first workable solution and do not spend time :)
to require at least one digit - is a good catch.
By the way, please help me with my english: which phrase could also be used with a meaning similar to is a good catch
?
"is a good catch" is probably the most appropriate phrase. "is a better solution" has a similar meaning. The difference is that "is a good catch" implies a problem with the existing code, while "is a better solution" doesn't imply a problem. In this case, either would work. I required at least one digit because I think that's more correct, but all that really happens is it falls back to the pure ruby parser. Also, the use of atoi requires at least one digit to work correctly, I think.
Don't worry, your English is certainly understandable, and pretty good for a non-native speaker. :)
I look to the dictionary often :)
It improves ragel parser to handle formats returned by this two databases. With this patch, home_run is just a bit slower than annoying monkey patch for sequel https://gist.github.com/871634
Times on my current machine:
With unpatched home run: