Comparison

plugins/mod_c2s.lua @ 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
parent 11509:dfdec3f9ccb1
child 11511:cab64a0aad49
comparison
equal deleted inserted replaced
11509:dfdec3f9ccb1 11510:d241ca8272fe
224 end 224 end
225 end 225 end
226 end, 200); 226 end, 200);
227 227
228 function runner_callbacks:ready() 228 function runner_callbacks:ready()
229 if self.data["conn"] ~= nil then self.data.conn:resume(); end 229 if self.data.conn then
230 self.data.conn:resume();
231 end
230 end 232 end
231 233
232 function runner_callbacks:waiting() 234 function runner_callbacks:waiting()
233 if self.data["conn"] ~= nil then self.data.conn:pause(); end 235 if self.data.conn then
236 self.data.conn:pause();
237 end
234 end 238 end
235 239
236 function runner_callbacks:error(err) 240 function runner_callbacks:error(err)
237 (self.data.log or log)("error", "Traceback[c2s]: %s", err); 241 (self.data.log or log)("error", "Traceback[c2s]: %s", err);
238 end 242 end