Quantcast

Re-wrote ItemLinkToID()

James D. Callahan III [03-10-11 - 09:26]
Re-wrote ItemLinkToID()
Filename
Scanner.lua
diff --git a/Scanner.lua b/Scanner.lua
index 12834f8..cf1a60f 100644
--- a/Scanner.lua
+++ b/Scanner.lua
@@ -519,15 +519,13 @@ local NO_ROLE_FLAG = {
 	---------------------------------------------------------------------------------------
 }

-local function ItemLinkToID(link)
-	if not link then
-		return
-	end
-	local _, _, id_num = string.find(link,"item:(%d+):")
+local function ItemLinkToID(item_link)
+	local id = item_link:match("item:(%d+)")

-	if id_num then
-		return tonumber(id_num)
+	if not id then
+		return
 	end
+	return tonumber(id)
 end