Permalink
Browse files

Improve grape performance

  • Loading branch information...
ka8725 committed Apr 27, 2016
1 parent 06a0a01 commit 044bcd5490a1935cc0f74557afe2351e0e085343
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/grape/util/stackable_values.rb
@@ -13,9 +13,10 @@ def initialize(inherited_values = {})
def [](name)
return @froozen_values[name] if @froozen_values.key? name
- value = [@inherited_values[name], @new_values[name]]
- value.compact!
- value.flatten!(1)
+
+ value = []
+ value.concat(@inherited_values[name]) if @inherited_values[name]
+ value.concat(@new_values[name]) if @new_values[name]
value
end

0 comments on commit 044bcd5

Please sign in to comment.