提交 2dafd87e 编写于 作者: V Viktar Basharymau

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)
上级 66dd2167
......@@ -96,14 +96,14 @@ def match_route(name, options)
def non_recursive(cache, options)
routes = []
stack = [cache]
queue = [cache]
while stack.any?
c = stack.shift
while queue.any?
c = queue.shift
routes.concat(c[:___routes]) if c.key?(:___routes)
options.each do |pair|
stack << c[pair] if c.key?(pair)
queue << c[pair] if c.key?(pair)
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册