From c1a047208dd2d00c26d5ace2640df2361cf3790e Mon Sep 17 00:00:00 2001 From: Hanada Date: Sat, 20 Jun 2026 15:42:28 +0800 Subject: [PATCH] style: fixed code style. Use nginx macros instead of the original "memmove" and remove unnecessary spaces. --- src/ngx_http_lua_accessby.c | 4 ++-- src/ngx_http_lua_precontentby.c | 4 ++-- src/ngx_http_lua_rewriteby.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ngx_http_lua_accessby.c b/src/ngx_http_lua_accessby.c index 39bdcda2bf..fcab72ccbf 100644 --- a/src/ngx_http_lua_accessby.c +++ b/src/ngx_http_lua_accessby.c @@ -64,8 +64,8 @@ ngx_http_lua_access_handler(ngx_http_request_t *r) tmp = *cur_ph; - memmove(cur_ph, cur_ph + 1, - (last_ph - cur_ph) * sizeof (ngx_http_phase_handler_t)); + ngx_memmove(cur_ph, cur_ph + 1, + (last_ph - cur_ph) * sizeof(ngx_http_phase_handler_t)); *last_ph = tmp; diff --git a/src/ngx_http_lua_precontentby.c b/src/ngx_http_lua_precontentby.c index 769e7c45a1..fe3d062207 100644 --- a/src/ngx_http_lua_precontentby.c +++ b/src/ngx_http_lua_precontentby.c @@ -56,8 +56,8 @@ ngx_http_lua_precontent_handler(ngx_http_request_t *r) tmp = *cur_ph; - memmove(cur_ph, cur_ph + 1, - (last_ph - cur_ph) * sizeof (ngx_http_phase_handler_t)); + ngx_memmove(cur_ph, cur_ph + 1, + (last_ph - cur_ph) * sizeof(ngx_http_phase_handler_t)); *last_ph = tmp; diff --git a/src/ngx_http_lua_rewriteby.c b/src/ngx_http_lua_rewriteby.c index 69302ba523..ab8da68df4 100644 --- a/src/ngx_http_lua_rewriteby.c +++ b/src/ngx_http_lua_rewriteby.c @@ -64,10 +64,10 @@ ngx_http_lua_rewrite_handler(ngx_http_request_t *r) if (cur_ph < last_ph) { dd("swapping the contents of cur_ph and last_ph..."); - tmp = *cur_ph; + tmp = *cur_ph; - memmove(cur_ph, cur_ph + 1, - (last_ph - cur_ph) * sizeof (ngx_http_phase_handler_t)); + ngx_memmove(cur_ph, cur_ph + 1, + (last_ph - cur_ph) * sizeof(ngx_http_phase_handler_t)); *last_ph = tmp;