# HG changeset patch # User Kim Alvefur # Date 1679834262 -7200 # Node ID 67777cb7353d51a862b17b2c4d0f4ab2a73fda39 # Parent 3e30799deec2e6128577a6d3b58cc8f63b0b50c8 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). diff -r 3e30799deec2 -r 67777cb7353d mod_http_oauth2/mod_http_oauth2.lua --- 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);