# HG changeset patch # User Kim Alvefur # Date 1616081027 -3600 # Node ID d241ca8272fe0daa01e17f104dfc7240fdfab534 # Parent dfdec3f9ccb1bdc81f782b9062af8a0579e25938 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`. diff -r dfdec3f9ccb1 -r d241ca8272fe plugins/mod_c2s.lua --- 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)