Changeset

11510:d241ca8272fe 0.11

mod_c2s: Improve code style We don't use the quoted table indexing style that often, it's not needed here and it's enough to check for falsyness rather than `nil`.
author Kim Alvefur <zash@zash.se>
date Thu, 18 Mar 2021 16:23:47 +0100
parents 11509:dfdec3f9ccb1
children 11511:cab64a0aad49
files plugins/mod_c2s.lua
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_c2s.lua	Wed Mar 17 12:47:16 2021 +0100
+++ b/plugins/mod_c2s.lua	Thu Mar 18 16:23:47 2021 +0100
@@ -226,11 +226,15 @@
 end, 200);
 
 function runner_callbacks:ready()
-	if self.data["conn"] ~= nil then self.data.conn:resume(); end
+	if self.data.conn then
+		self.data.conn:resume();
+	end
 end
 
 function runner_callbacks:waiting()
-	if self.data["conn"] ~= nil then self.data.conn:pause(); end
+	if self.data.conn then
+		self.data.conn:pause();
+	end
 end
 
 function runner_callbacks:error(err)