datbth commented on code in PR #43882:
URL: https://github.com/apache/arrow/pull/43882#discussion_r1735788013
##########
ruby/red-arrow/lib/arrow/decimal128-array.rb:
##########
@@ -18,7 +18,9 @@
module Arrow
class Decimal128Array
def get_value(i)
- BigDecimal(format_value(i))
+ string = format_value(i)
+ string.sub!(".E", ".0E") if string.include?(".E")
Review Comment:
I see. Thank you for explaining to me.
Would `string.sub!(".E", ".0E")` (without `include?`) still be better?
It saves 1 string scan and is shown to be faster in the above benchmark.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]