Remove findallpaths()

Mon, 26 Oct 2009 02:31:57 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 26 Oct 2009 02:31:57 +0000
changeset 2
251fd96e1c34
parent 1
036168493972
child 3
842f3003db2a

Remove findallpaths()

luatraverse.lua file | annotate | diff | comparison | revisions
--- a/luatraverse.lua	Mon Oct 26 02:29:45 2009 +0000
+++ b/luatraverse.lua	Mon Oct 26 02:31:57 2009 +0000
@@ -46,36 +46,6 @@
 	return count
 end
 
--- Prints all paths to an object
-function findallpaths(obj)
-	
-	local comefrom = {}
-	local f = function(from, to, how, value)
-		if not comefrom[to] then comefrom[to] = {} end
-		table.insert(comefrom[to], 1, {f = from, h = how, v=value})		
-	end
-	
-	traverse({edge=f}, {comefrom, f})
-	
-	
-	local function printpath(to)
-		if not to or comefrom[to].visited or to == _G then
-			print("-----")
-			return
-		end
-		comefrom[to].visited = true
-		for i=1, #comefrom[to] do
-			local tfrom = comefrom[to][i].f
-			print("from: ", tfrom, "\nhow:", comefrom[to][i].h,
-					"\nvalue:", comefrom[to][i].v)
-			printpath(tfrom)
-		end			
-	end
-	
-	printpath(obj)
-	
-end
-
 -- Main function
 -- 'funcs' is a table that contains a funcation for every lua type and also the
 -- function edge edge (traverseedge).

mercurial