Avoid array allocation in DSL::Parameters#with#2672
Open
ericproulx wants to merge 3 commits intomasterfrom
Open
Avoid array allocation in DSL::Parameters#with#2672ericproulx wants to merge 3 commits intomasterfrom
ericproulx wants to merge 3 commits intomasterfrom
Conversation
Replace five specific exception classes (EmptyMessageBody, TooManyMultipartFiles, TooDeepParameters, ConflictingTypes, InvalidParameters) with a single Grape::Exceptions::RequestError that forwards the Rack exception message directly. On Rack 3, a single `rescue Rack::BadRequest` covers all bad-request errors via the marker module. On Rack 2, each exception class is listed explicitly in Grape::RACK_ERRORS. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace redundant `key: key` kwargs with the shorthand `key:` form where the local variable name matches the keyword argument name. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Danger ReportNo issues found. |
cbe0355 to
bec4677
Compare
Replace `[@group, opts].compact.reduce(&:deep_merge)` with `@group&.deep_merge(opts) || opts` to avoid allocating a temporary array on every `with` block call. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bec4677 to
de2fbcb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[@group, opts].compact.reduce(&:deep_merge)with@group&.deep_merge(opts) || optswithblock callHash#deep_mergealways returns a Hash)Test plan
bundle exec rspec spec/grape/dsl/parameters_spec.rb— 23 examples, 0 failures🤖 Generated with Claude Code