| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \
| |/ /
|/| | |
Remove unnecessary require of Minitest.
|
| | |
| | |
| | |
| | | |
Minitest has already been required when calling Minitest.autorun.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fixes URL generation with trailing_slash: true
Conflicts:
actionpack/lib/action_dispatch/http/url.rb
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
URL generation with trailing_slash: true was adding a trailing slash
after .:format
Routes.draw do
resources :bars
end
bars_url(trailing_slash: true, format: 'json')
# => /bars.json/
This commit removes that extra trailing slash
|
|\ \ \ \
| | | | |
| | | | | |
Fix router visualizer CSS and JS resources
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
I know, it's crazy.
|
| | | | | |
|
|/ / / / |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
this also changes the constructor. We don't need to pass more options
than "defaults" (whatever defaults are, ugh. probably another hash of
stupid stuff).
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
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
```
|
|\ \ \ \
| | | | |
| | | | | |
Use `break` instead of `next` in AD::Journey::Formatter#match_route
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|/ / /
| | |
| | |
| | | |
It was changed by mistake at c5d64b2b86aa42f57881091491ee289b3c489c7e.
|
| | |
| | |
| | |
| | | |
There are performance gains to be made by avoiding URI setter methods.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
so tht I don't go totally insane with THsi crazy hash driven
development. why is Everything a hash? Why do people think hashes in
hashes with random keys is a Good API? You can't find things or
deprecate them or control access whatsoever, you just have to hope that
everyone is like "oh, you want to change that? that's cool! we all know
it's hashes so go for it!"
The End.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
The optimized and non-optimized path share more code now without
significant performance degretation
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Example:
x = [1,2,3,4]
y = [3,2,1]
def test x, y
hash = {}
x.zip(y) { |k,v| hash[k] = v }
hash
end
def test2 x, y
Hash[x.zip(y)]
end
def test3 x, y
x.zip(y).each_with_object({}) { |(k,v),hash| hash[k] = v }
end
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
stat(100) { test(x,y) }
stat(100) { test2(x,y) }
stat(100) { test3(x,y) }
__END__
2 allocations per call
7 allocations per call
8 allocations per call
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Remove redundant code.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|