mirror of
https://github.com/urbit/shrub.git
synced 2024-12-26 05:23:35 +03:00
graph-store: use +lien instead of manual recursion
This commit is contained in:
parent
b319928059
commit
45fb7e69f3
@ -215,27 +215,27 @@
|
|||||||
++ check-for-duplicates
|
++ check-for-duplicates
|
||||||
|= [=graph:store nodes=(set index:store)]
|
|= [=graph:store nodes=(set index:store)]
|
||||||
^- ?
|
^- ?
|
||||||
=/ node-list ~(tap in nodes)
|
|^
|
||||||
|-
|
%+ lien ~(tap in nodes)
|
||||||
?~ node-list %.n
|
|= =index:store
|
||||||
?: (has-node graph i.node-list) %.y
|
(has-node graph index)
|
||||||
$(node-list t.node-list)
|
::
|
||||||
::
|
++ has-node
|
||||||
++ has-node
|
|= [=graph:store =index:store]
|
||||||
|= [=graph:store =index:store]
|
^- ?
|
||||||
^- ?
|
=/ node=(unit node:store) ~
|
||||||
=/ node=(unit node:store) ~
|
|-
|
||||||
|-
|
?~ index
|
||||||
?~ index
|
?=(^ node)
|
||||||
?=(^ node)
|
?~ t.index
|
||||||
?~ t.index
|
?=(^ (get:orm graph i.index))
|
||||||
?=(^ (get:orm graph i.index))
|
=. node (get:orm graph i.index)
|
||||||
=. node (get:orm graph i.index)
|
?~ node %.n
|
||||||
?~ node %.n
|
?- -.children.u.node
|
||||||
?- -.children.u.node
|
%empty %.n
|
||||||
%empty %.n
|
%graph $(graph p.children.u.node, index t.index)
|
||||||
%graph $(graph p.children.u.node, index t.index)
|
==
|
||||||
==
|
--
|
||||||
::
|
::
|
||||||
++ sort-nodes
|
++ sort-nodes
|
||||||
|= nodes=(map index:store node:store)
|
|= nodes=(map index:store node:store)
|
||||||
|
Loading…
Reference in New Issue
Block a user