Skip to content

Commit

Permalink
style(router): minor code style clean (#11449)
Browse files Browse the repository at this point in the history
style(router): minor code style clean
  • Loading branch information
chronolaw authored Aug 29, 2023
1 parent feffc2e commit ba559ea
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions kong/router/compat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ local _M = {}
local bit = require("bit")
local buffer = require("string.buffer")
local atc = require("kong.router.atc")
local utils = require("kong.router.utils")
local tb_new = require("table.new")
local tb_nkeys = require("table.nkeys")
local uuid = require("resty.jit-uuid")


local shallow_copy = require("kong.tools.utils").shallow_copy
local is_regex_magic = require("kong.router.utils").is_regex_magic


local is_regex_magic = utils.is_regex_magic
local parse_ip_addr = utils.parse_ip_addr


local escape_str = atc.escape_str
local is_empty_field = atc.is_empty_field
local gen_for_field = atc.gen_for_field
local split_host_port = atc.split_host_port
local parse_ip_addr = require("kong.router.utils").parse_ip_addr


local type = type
Expand Down Expand Up @@ -404,7 +407,8 @@ local function get_priority(route)

if headers_count > MAX_HEADER_COUNT then
ngx.log(ngx.WARN, "too many headers in route ", route.id,
" headers count capped at 255 when sorting")
" headers count capped at ", MAX_HEADER_COUNT,
" when sorting")
headers_count = MAX_HEADER_COUNT
end
end
Expand Down Expand Up @@ -533,9 +537,10 @@ end


local function split_routes_and_services_by_path(routes_and_services)
local routes_and_services_split = tb_new(#routes_and_services, 0)
local count = #routes_and_services
local routes_and_services_split = tb_new(count, 0)

for i = 1, #routes_and_services do
for i = 1, count do
split_route_by_path_into(routes_and_services[i], routes_and_services_split)
end

Expand Down

1 comment on commit ba559ea

@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:ba559eadf3468b77260413831405e17f3c326206
Artifacts available https://github.com/Kong/kong/actions/runs/6008483614

Please sign in to comment.