apisix icon indicating copy to clipboard operation
apisix copied to clipboard

perf: In function is_empty_yaml_line, 'string.find' plain mode is not recommended, and re.find is better.

Open Miss-you opened this issue 6 years ago • 2 comments

Issue description

local function is_empty_yaml_line(line)
    return line == '' or string.find(line, '^%s*$') or
           string.find(line, '^%s*#')
end

Environment

  • apisix version (cmd: apisix version):
  • OS:

Minimal test code / Steps to reproduce the issue

1. 2. 3.

What's the actual result? (including assertion message & call stack if applicable)

What's the expected result?

Miss-you avatar Nov 18 '20 15:11 Miss-you

Is there test data to prove it is better?

idbeta avatar Nov 19 '20 10:11 idbeta

Currently bin/apisix is interpreted by the Lua.

tokers avatar Nov 20 '20 02:11 tokers