Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/change_disable_bigdecimal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#520](https://github.com/rubocop/rubocop-performance/issues/520): Disable `Performance/BigDecimalWithNumericArgument` by default. ([@earlopain][])
3 changes: 2 additions & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ Performance/ArraySemiInfiniteRangeSlice:

Performance/BigDecimalWithNumericArgument:
Description: 'Convert numeric literal to string and pass it to `BigDecimal`.'
Enabled: 'pending'
Enabled: false
VersionAdded: '1.7'
VersionChanged: <<next>>

Performance/BindCall:
Description: 'Use `bind_call(obj, args, ...)` instead of `bind(obj).call(args, ...)`.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ module Performance
# Also identifies places where an integer string argument to BigDecimal should be converted to
# an integer. Initializing from Integer is faster than from String for BigDecimal.
#
# NOTE: This cop is disabled by default because the performance of initializing with a String
# and Number differ between versions. Additionally, performance depends on the size of the Number,
# and if it is an Integer or a Float. Since this is very specific to `bigdecimal` internals,
# suggestions from this cop are not unlikely to result in code that performs worse than before.
#
# @example
# # bad
# BigDecimal(1.2, 3, exception: true)
Expand Down