Skip to content

Commit

Permalink
Revert "perf(router): iterate routes with for loop (#11111)"
Browse files Browse the repository at this point in the history
This reverts commit e8173ca.
  • Loading branch information
chronolaw authored and dndx committed Aug 10, 2023
1 parent f55614c commit 66363e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions kong/router/atc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,7 @@ local function new_from_scratch(routes, get_exp_and_priority)

local new_updated_at = 0

for i = 1, routes_n do
local r = routes[i]

for _, r in ipairs(routes) do
local route = r.route
local route_id = route.id

Expand Down Expand Up @@ -249,9 +247,7 @@ local function new_from_previous(routes, get_exp_and_priority, old_router)
local new_updated_at = 0

-- create or update routes
for i = 1, #routes do
local r = routes[i]

for _, r in ipairs(routes) do
local route = r.route
local route_id = route.id

Expand Down
4 changes: 2 additions & 2 deletions kong/router/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ do
local v0 = 0
local v1 = 0

for i = 1, #routes do
local r = routes[i].route
for _, route in ipairs(routes) do
local r = route.route

local paths_t = r.paths or empty_table
local headers_t = r.headers or empty_table
Expand Down

1 comment on commit 66363e4

@khcp-gha-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:66363e46e2524a44f363e96663c54c7ace6c8cb6
Artifacts available https://github.com/Kong/kong/actions/runs/5817645841

Please sign in to comment.