Better names for variables
authorMatthew Wild <mwild1@gmail.com>
Fri, 21 Nov 2008 05:07:41 +0000 (05:07 +0000)
committerMatthew Wild <mwild1@gmail.com>
Fri, 21 Nov 2008 05:07:41 +0000 (05:07 +0000)
util/jid.lua

index efa79b38a8505b98e95f165392951b5216314def..2e40a3388d286a13de429b42b6712a61dff0b968 100644 (file)
@@ -5,11 +5,11 @@ module "jid"
 
 function split(jid)
        if not jid then return; end
-       local node, nodelen = match(jid, "^([^@]+)@()");
-       local host, hostlen = match(jid, "^([^@/]+)()", nodelen)
+       local node, nodepos = match(jid, "^([^@]+)@()");
+       local host, hostpos = match(jid, "^([^@/]+)()", nodepos)
        if node and not host then return nil, nil, nil; end
-       local resource = match(jid, "^/(.+)$", hostlen);
-       if (not host) or ((not resource) and #jid >= hostlen) then return nil, nil, nil; end
+       local resource = match(jid, "^/(.+)$", hostpos);
+       if (not host) or ((not resource) and #jid >= hostpos) then return nil, nil, nil; end
        return node, host, resource;
 end