rm push/pop
This commit is contained in:
12
graph.ce
12
graph.ce
@@ -98,7 +98,7 @@ function gather_graph(locator, visited) {
|
||||
arrfor(array(deps), function(alias) {
|
||||
var dep_locator = deps[alias]
|
||||
add_node(dep_locator)
|
||||
push(edges, { from: locator, to: dep_locator, alias: alias })
|
||||
edges[] = { from: locator, to: dep_locator, alias: alias }
|
||||
gather_graph(dep_locator, visited)
|
||||
})
|
||||
}
|
||||
@@ -117,7 +117,7 @@ if (show_world) {
|
||||
packages = shop.list_packages()
|
||||
arrfor(packages, function(p) {
|
||||
if (p != 'core') {
|
||||
push(roots, p)
|
||||
roots[] = p
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@@ -128,7 +128,7 @@ if (show_world) {
|
||||
|
||||
target_locator = shop.resolve_locator(target_locator)
|
||||
|
||||
push(roots, target_locator)
|
||||
roots[] = target_locator
|
||||
}
|
||||
|
||||
arrfor(roots, function(root) {
|
||||
@@ -164,7 +164,7 @@ if (format == 'tree') {
|
||||
children = []
|
||||
arrfor(edges, function(e) {
|
||||
if (e.from == locator) {
|
||||
push(children, e)
|
||||
children[] = e
|
||||
}
|
||||
})
|
||||
|
||||
@@ -180,7 +180,7 @@ if (format == 'tree') {
|
||||
children = []
|
||||
arrfor(edges, function(e) {
|
||||
if (e.from == roots[i]) {
|
||||
push(children, e)
|
||||
children[] = e
|
||||
}
|
||||
})
|
||||
|
||||
@@ -230,7 +230,7 @@ if (format == 'tree') {
|
||||
}
|
||||
|
||||
arrfor(array(nodes), function(id) {
|
||||
push(output.nodes, nodes[id])
|
||||
output.nodes[] = nodes[id]
|
||||
})
|
||||
|
||||
output.edges = edges
|
||||
|
||||
Reference in New Issue
Block a user