aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-12 04:21:11 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-12 04:21:11 +0100
commitdda51b1e34c3c3e5f8fe7f08616e125812da1d5b (patch)
treeebc615cd72659efba3f1b1ea5f6cd38523e7caae
parent1abb451d7aab4b99ded8e3336bc8e7c86cecc3dd (diff)
downloadvicious-legacy-dda51b1e34c3c3e5f8fe7f08616e125812da1d5b.tar.xz
net: remove redudant string.match call
-rw-r--r--net.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/net.lua b/net.lua
index d477248..365d3c6 100644
--- a/net.lua
+++ b/net.lua
@@ -33,8 +33,8 @@ local function worker(format)
for line in f:lines() do
-- Match wmaster0 as well as rt0 (multiple leading spaces)
- if string.match(line, "^[%s]?[%s]?[%s]?[%s]?[%w]+:") then
- local name = string.match(line, "^[%s]?[%s]?[%s]?[%s]?([%w]+):")
+ local name = string.match(line, "^[%s]?[%s]?[%s]?[%s]?([%w]+):")
+ if name ~= nil then
-- Received bytes, first value after the name
local recv = tonumber(string.match(line, ":[%s]*([%d]+)"))
-- Transmited bytes, 7 fields from end of the line