diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2020-09-10 00:15:29 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2020-10-11 12:19:26 -0400 |
commit | c58b95f2976a0563884a09a6aafb5e1332e3ca3b (patch) | |
tree | 2262699f6c12134fc7e7bf76db1a21ceb7903815 /src/http_header.c | |
parent | 327de98b38d84921e342422f34848a4f85a4da9c (diff) | |
download | lighttpd-git-c58b95f2976a0563884a09a6aafb5e1332e3ca3b.tar.gz |
[core] light_isupper(), light_islower()
more efficient char checks
(replace one comparision and one branch with one subtraction)
Diffstat (limited to 'src/http_header.c')
-rw-r--r-- | src/http_header.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http_header.c b/src/http_header.c index 5f206692..d382cc87 100644 --- a/src/http_header.c +++ b/src/http_header.c @@ -195,7 +195,7 @@ void http_header_response_insert(request_st * const r, enum http_header_e id, co r->resp_header_repeated = 1; char * const h = buffer_string_prepare_append(vb, klen + vlen + 2); for (uint32_t i = 0; i < klen; ++i) - h[i] = (k[i] < 'A' || k[i] > 'Z') ? k[i] : (k[i] | 0x20); + h[i] = !light_isupper(k[i]) ? k[i] : (k[i] | 0x20); buffer_commit(vb, klen); } else |