From 6b08ecc1fa40e2cb632dd629a4064901d8157f7d Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Wed, 10 May 2017 00:14:29 -0700 Subject: [PATCH] Don't iterate twice --- addon/helpers/route-action.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addon/helpers/route-action.js b/addon/helpers/route-action.js index 0c460de..417ac14 100644 --- a/addon/helpers/route-action.js +++ b/addon/helpers/route-action.js @@ -68,10 +68,9 @@ function getCurrentHandlers(router) { return getCurrentHandlerInfos(router) .reduce((acc, h) => { return h.name === currentRouteName || h.name === currentRoot - ? [...acc, h.handler] + ? [h.handler, ...acc] : acc; - }, []) - .reverse(); + }, []); } /**