Skip to content

Commit 4acd0a5

Browse files
committed
cleaner adjmat
1 parent 1117d32 commit 4acd0a5

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/SQLiteGraph.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,8 @@ Base.getindex(db::DB, ::Colon, ::Colon, ::Colon) = (Edge(row) for row in query(d
181181
function adjacency_matrix(db::DB)
182182
n = n_nodes(db)
183183
out = falses(n, n)
184-
src, tgt = Int[], Int[]
185184
for row in execute(db, "SELECT DISTINCT source, target FROM edges;")
186-
push!(src, row.source)
187-
push!(tgt, row.target)
188-
end
189-
for (i,j) in zip(src, tgt)
190-
out[i,j] = true
185+
out[row.source, row.target] = true
191186
end
192187
out
193188
end

0 commit comments

Comments
 (0)