Changeset

3030:4a7f08fe793c

mod_pastebin: Remove redundant check for non-empty body since it returns earlier in that case
author Kim Alvefur <zash@zash.se>
date Sun, 20 May 2018 17:54:47 +0200
parents 3029:7878dc2dbf59
children 3031:040eaa3844f4
files mod_pastebin/mod_pastebin.lua
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_pastebin/mod_pastebin.lua	Sun May 20 17:51:08 2018 +0200
+++ b/mod_pastebin/mod_pastebin.lua	Sun May 20 17:54:47 2018 +0200
@@ -107,12 +107,10 @@
 
 	--module:log("debug", "Body(%s) length: %d", type(body), #(body or ""));
 
-	if body and (
-		((#body > length_threshold)
-		 and (utf8_length(body) > length_threshold)) or
+	if ( #body > length_threshold and utf8_length(body) > length_threshold ) or
 		(trigger_string and body:find(trigger_string, 1, true) == 1) or
 		(select(2, body:gsub("\n", "%0")) >= line_threshold)
-	) then
+	then
 		if trigger_string and body:sub(1, #trigger_string) == trigger_string then
 			body = body:sub(#trigger_string+1);
 		end