xmlhandlers: Removed an unnecessary check
authorWaqas Hussain <waqas20@gmail.com>
Fri, 15 May 2009 02:27:03 +0000 (07:27 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Fri, 15 May 2009 02:27:03 +0000 (07:27 +0500)
core/xmlhandlers.lua

index ed6f6a482b2122407f71867e3f37a698378cdf98..fc070115473be34fa59915319c5009fa5e8cc0a9 100644 (file)
@@ -14,7 +14,6 @@ local st = stanza;
 local tostring = tostring;
 local pairs = pairs;
 local ipairs = ipairs;
-local type = type;
 local t_insert = table.insert;
 local t_concat = table.concat;
 
@@ -62,15 +61,13 @@ function init_xmlhandlers(session, stream_callbacks)
                        
                        -- FIXME !!!!!
                        for i, k in ipairs(attr) do
-                               if type(k) == "string" then
-                                       local ns, nm = k:match("^([^|]+)|?([^|]-)$")
-                                       if ns and nm then
-                                               ns = ns_prefixes[ns]; 
-                                               if ns then 
-                                                       attr[ns..":"..nm] = attr[k];
-                                                       attr[i] = ns..":"..nm;
-                                                       attr[k] = nil;
-                                               end
+                               local ns, nm = k:match("^([^|]+)|?([^|]-)$")
+                               if ns and nm then
+                                       ns = ns_prefixes[ns]; 
+                                       if ns then 
+                                               attr[ns..":"..nm] = attr[k];
+                                               attr[i] = ns..":"..nm;
+                                               attr[k] = nil;
                                        end
                                end
                        end