Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "perf(router): iterate routes with for loop (#11111)" #11375

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions kong/router/atc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,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
Loading