clix.raw: Linearise condition

Sat, 10 Apr 2021 00:21:05 +0200

author
Kim Alvefur <zash@zash.se>
date
Sat, 10 Apr 2021 00:21:05 +0200
changeset 149
014e73c329c5
parent 148
27a9f28724d3
child 150
af9b9acb10d6

clix.raw: Linearise condition

Goal of having the 'send_xml' string always exist in one place, so we
can do things with it regardless of where it came from.

clix/raw.lua file | annotate | diff | comparison | revisions
--- a/clix/raw.lua	Mon Feb 08 22:59:49 2021 +0100
+++ b/clix/raw.lua	Sat Apr 10 00:21:05 2021 +0200
@@ -110,11 +110,10 @@
 				onincoming = on_incoming, ondisconnect = function () end
 				}, "*l");
 		else
-			if send_xml then
-				conn:send(send_xml);
-			else
-				conn:send(table.concat(args, " "));
+			if not send_xml then
+				send_xml = table.concat(args, " ");
 			end
+			conn:send(send_xml);
 			conn:close();
 		end
 

mercurial