• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-grape / grape / 26744664330

01 Jun 2026 08:46AM UTC coverage: 96.863% (+0.002%) from 96.861%
26744664330

Pull #2754

github

ericproulx
Merge routing args in place in Router#process_route

process_route built `args = env[GRAPE_ROUTING_ARGS] || { route_info: route }`
and then reassigned `env[GRAPE_ROUTING_ARGS] = args.merge(route_params)`, which
allocates a second Hash for every matched route that carries params.

Set the routing-args Hash once with `||=` and `merge!` the route params into it
in place, dropping the extra allocation. The resulting routing args are
identical (same keys and values); only the merge is now in-place. `route_params`
is a freshly built Hash, so nothing shared is mutated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pull Request #2754: Merge routing args in place in Router#process_route

1103 of 1193 branches covered (92.46%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 1 file covered. (100.0%)

1 existing line in 1 file now uncovered.

3529 of 3589 relevant lines covered (98.33%)

23276.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.15
/lib/grape/exceptions/validation_errors.rb


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc