Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure Style/NumericPredicate for performance #356

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ Style/DocumentDynamicEvalDefinition:

Style/MultipleComparison:
Enabled: false

Style/NumericPredicate:
EnforcedStyle: comparison
2 changes: 1 addition & 1 deletion benchmarks/benchmarks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def positional_splat_keyword_and_double_splat_args(a, *args, b:, **kwargs)
benchmark_json.sort_by! { |json| json["name"] }

# Print headers based on the first benchmark_json
if i.zero?
if i == 0
benchmark_headers = benchmark_json.map do |benchmark_gem|
# Gem name is of the form:
# "memoist (1.1.0): ()"
Expand Down
2 changes: 1 addition & 1 deletion lib/memo_wise/internal_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def self.create_memo_wise_state!(obj)
# - :double_splat (examples: `def foo(a: 1)`, `def foo(a:, **b)`)
# - :splat_and_double_splat (examples: `def foo(a=1, b: 2)`, `def foo(a=1, **b)`, `def foo(*a, **b)`)
def self.method_arguments(method)
return NONE if method.arity.zero?
return NONE if method.arity == 0

parameters = method.parameters.map(&:first)

Expand Down