summaryrefslogtreecommitdiffstats
path: root/modules/lua
diff options
context:
space:
mode:
authorJim Jagielski <jim@apache.org>2017-01-09 23:08:01 +0100
committerJim Jagielski <jim@apache.org>2017-01-09 23:08:01 +0100
commitcc97ce3e52770d69c6de9aa7f2be85fae69509f7 (patch)
tree00a4531671abced6d59fd7e11952cf7d7683619f /modules/lua
parentClarify wishlist (diff)
downloadapache2-cc97ce3e52770d69c6de9aa7f2be85fae69509f7.tar.xz
apache2-cc97ce3e52770d69c6de9aa7f2be85fae69509f7.zip
https://bz.apache.org/bugzilla/show_bug.cgi?id=58855
Optimize check for empty strings git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1778067 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/lua')
-rw-r--r--modules/lua/lua_dbd.c2
-rw-r--r--modules/lua/lua_request.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/lua/lua_dbd.c b/modules/lua/lua_dbd.c
index 8b61a60b10..1b8d5b7764 100644
--- a/modules/lua/lua_dbd.c
+++ b/modules/lua/lua_dbd.c
@@ -782,7 +782,7 @@ int lua_db_acquire(lua_State *L)
arguments = lua_tostring(L, 3);
lua_settop(L, 0);
- if (strlen(arguments)) {
+ if (*arguments) {
rc = apr_dbd_open_ex(dbdhandle->driver, pool,
arguments, &dbdhandle->handle, &error);
if (rc == APR_SUCCESS) {
diff --git a/modules/lua/lua_request.c b/modules/lua/lua_request.c
index d56bfd41bc..1f3d18d687 100644
--- a/modules/lua/lua_request.c
+++ b/modules/lua/lua_request.c
@@ -382,7 +382,7 @@ static int req_parsebody(lua_State *L)
sscanf(start + len + 2,
"Content-Disposition: form-data; name=\"%255[^\"]\"; filename=\"%255[^\"]\"",
key, filename);
- if (strlen(key)) {
+ if (*key) {
req_aprtable2luatable_cb_len(L, key, buffer, vlen);
}
}
@@ -2110,8 +2110,8 @@ static int lua_set_cookie(lua_State *L)
secure ? "Secure;" : "",
expires ? strexpires : "",
httponly ? "HttpOnly;" : "",
- strlen(strdomain) ? strdomain : "",
- strlen(strpath) ? strpath : "");
+ *strdomain ? strdomain : "",
+ *strpath ? strpath : "");
apr_table_add(r->err_headers_out, "Set-Cookie", out);
return 0;