]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: http: avoid duplicating literals in find_http_meth()
authorWilly Tarreau <w@1wt.eu>
Wed, 10 Jan 2024 10:28:28 +0000 (11:28 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jan 2024 14:10:08 +0000 (15:10 +0100)
commit59c01f1091c3f7d7c72d7e456ad2b9d70ca46081
treef6be517d752134bc0cd9f8b5f5df7449d7371eb9
parent19def65228c5b6799037d8ad02a7af91cd7eab65
CLEANUP: http: avoid duplicating literals in find_http_meth()

The function does the inverse of http_known_methods[], better rely on
that array with its indices, that makes the code clearer. Note that
we purposely don't use a loop because the compiler is able to build
an evaluation tree of the size checks and content checks that's very
efficient for the most common methods. Moving a few unimportant
entries even simplified the output code a little bit (they're now
groupped by size without changing anything for the first ones).
src/http.c