| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* constraints:
rm reset_parameters because we automatically do it from 9ca4839a
move path_parameter encoding check to the request object
dispatcher doesn't need `call` anymore
call `serve` with the request on dispatchers
constraints class does not need the request class anymore
give all endpoints a superclass
skip the build business if the stack is empty
stop hardcoding path_parameters and get it from the request
we do not need to cache rack_app
a redirect is not a dispatcher by definition, so eliminate test
push is_a check up to where the Constraints object is allocated
pass the request object to the application
pass a request to `matches?` so we can avoid creating excess requests
nothing is passed to `rack_app` anymore, so rm the params
one fewer is_a check
Constraints#app should never return another Constraints object, so switch to if statement
eliminate dispatcher is_a checks
push is_a?(Dispatcher) check in to one place
Always construct route objects with Constraint objects
Conflicts:
actionpack/lib/action_controller/metal.rb
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | |
| | | |
tgxworld/only_find_routes_as_heads_for_head_request
Call get_routes_as_head only on HEAD requests.
|
| |/ |
|
|/ |
|
|
|
|
|
|
|
| |
Unwrap Constraints objects. I don't actually think it's possible
to pass a Constraints object to this constructor, but there were
multiple places that kept testing children of this object. I
*think* they were just being defensive, but I have no idea.
|
| |
|
| |
|
|\
| |
| | |
Remove AD::Journey::Formatter#verify_required_parts!
|
| |
| |
| |
| |
| | |
Nobody uses this private method, maybe it is a leftover from some old
refactoring. Let's delete it.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
stop hardcoding hash keys and use the accessors provided on the request
object.
|
|
|
|
| |
this decouples our code from the env hash a bit.
|
| |
|
|\
| |
| | |
Rename `stack` to `queue`
|
| |
| |
| |
| |
| |
| |
| | |
Because it is used as a queue (FIFO), not as a stack (LIFO).
* http://en.wikipedia.org/wiki/Stack_(abstract_data_type)
* http://en.wikipedia.org/wiki/Queue_(data_structure)
|
|\ \
| | |
| | | |
Remove unnecessary `Hash#to_a` call
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Inspired by https://github.com/rails/rails/commit/931ee4186b877856b212b0085cd7bd7f6a4aea67
```ruby
def stat(num)
start = GC.stat(:total_allocated_object)
num.times { yield }
total_obj_count = GC.stat(:total_allocated_object) - start
puts "#{total_obj_count / num} allocations per call"
end
h = { 'x' => 'y' }
stat(100) { h. each { |pair| pair } }
stat(100) { h.to_a.each { |pair| pair } }
__END__
1 allocations per call
2 allocations per call
```
|
|/
|
|
|
|
| |
The array is sorted in descending order, so there is no point in
iterating further if we met a negative item - all the rest will be
negative too.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The optimized and non-optimized path share more code now without
significant performance degretation
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 5c224de9e110763ec7a0f01f5b604bcf81f40bfb.
Conflicts:
actionpack/lib/action_dispatch/journey/visitors.rb
5c224de9e110763ec7a0f01f5b604bcf81f40bfb introduced a bug in the
formatter. This commit includes a regression test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Escape '%' characters in URLs - only unescaped data
should be passed to URL helpers
2. Add an `escape_segment` helper to `Router::Utils`
that escapes '/' characters
3. Use `escape_segment` rather than `escape_fragment`
in optimized URL generation
4. Use `escape_segment` rather than `escape_path`
in URL generation
For point 4 there are two exceptions. Firstly, when a route uses wildcard
segments (e.g. *foo) then we use `escape_path` as the value may contain '/'
characters. This means that wildcard routes can't be optimized. Secondly,
if a `:controller` segment is used in the path then this uses `escape_path`
as the controller may be namespaced.
Fixes #14629, #14636 and #14070.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The URI::Parser#escape method is a general use method that has to deal
with a variety of input however our use of it is limited in scope so
we can increase the performance by implementing our specific needs
within ActionDispatch::Journey::Router::Utils directly.
If there is no encoding required then there is no change in performance
or number of objects allocated, but for each character that needs to be
encoded we save five object allocations and gain a performance boost.
The performance boost seen varies from 20% when there is one character
to over 50% when encoding ten characters.
|
|
|
|
|
|
|
|
|
|
| |
Makes it clear that anything passed with the helper must not be percent encoded.
Fixes previous behavior which tricks people into believing passing
non-percent-encoded will generate a proper percent-encoded path while in
reality it doesn't ('%' isn't escaped).
The intention is nice but the heuristic is broken.
|
| |
|
| |
|
| |
|
| |
|
| |
|