Changeset

5276:67777cb7353d

mod_http_oauth2: Pedantic optimization Checking the length of the string seems like 30% more expensive than comparing it with the empty string (by reference, probably).
author Kim Alvefur <zash@zash.se>
date Sun, 26 Mar 2023 14:37:42 +0200
parents 5275:3e30799deec2
children 5277:a1055024b94e
files mod_http_oauth2/mod_http_oauth2.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_oauth2/mod_http_oauth2.lua	Sat Mar 25 20:18:05 2023 +0100
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Sun Mar 26 14:37:42 2023 +0200
@@ -335,7 +335,7 @@
 local function get_auth_state(request)
 	local form = request.method == "POST"
 	         and request.body
-	         and #request.body > 0
+	         and request.body ~= ""
 	         and request.headers.content_type == "application/x-www-form-urlencoded"
 	         and http.formdecode(request.body);