mirror of
https://github.com/urbit/shrub.git
synced 2024-12-21 18:01:32 +03:00
hark, graph-store: address L review
This commit is contained in:
parent
dfc3ef0c0e
commit
9c7ac3773a
@ -452,18 +452,16 @@
|
||||
++ get-descendants
|
||||
|= =graph:store
|
||||
=| indices=(list index:store)
|
||||
=/ nodes=(list [atom node:store])
|
||||
(tap:orm:store graph)
|
||||
=/ nodes (tap:orm:store graph)
|
||||
%- ~(gas in *(set index:store))
|
||||
|- =* tap-nodes $
|
||||
^+ indices
|
||||
%- zing
|
||||
%+ turn
|
||||
nodes
|
||||
%+ turn nodes
|
||||
|= [atom =node:store]
|
||||
^- (list index:store)
|
||||
%+ welp
|
||||
(limo index.post.node ~)
|
||||
index.post.node^~
|
||||
?. ?=(%graph -.children.node)
|
||||
~
|
||||
%_ tap-nodes
|
||||
@ -473,18 +471,18 @@
|
||||
++ remove-index
|
||||
=| indices=(set index:store)
|
||||
|= [=graph:store =index:store]
|
||||
^- [_indices graph:store]
|
||||
^- [(set index:store) graph:store]
|
||||
?~ index [indices graph]
|
||||
=* atom i.index
|
||||
:: last index in list
|
||||
::
|
||||
?~ t.index
|
||||
=^ u-val graph (del:orm graph atom)
|
||||
?~ u-val `graph
|
||||
?. ?=(%graph -.children.u.u-val)
|
||||
=^ rm-node graph (del:orm graph atom)
|
||||
?~ rm-node `graph
|
||||
?. ?=(%graph -.children.u.rm-node)
|
||||
`graph
|
||||
=/ new-indices
|
||||
(get-descendants p.children.u.u-val)
|
||||
(get-descendants p.children.u.rm-node)
|
||||
[(~(uni in indices) new-indices) graph]
|
||||
=/ =node:store
|
||||
~| "parent index does not exist to remove a node from!"
|
||||
|
@ -197,7 +197,8 @@
|
||||
=/ =stats-index:store
|
||||
[%graph rid (scag parent-lent.notif-kind index)]
|
||||
?. ?=(%each mode.notif-kind) out
|
||||
:_(out (poke-hark %read-each stats-index index))
|
||||
:_ out
|
||||
(poke-hark %read-each stats-index index)
|
||||
::
|
||||
++ poke-hark
|
||||
|= =action:store
|
||||
|
@ -85,13 +85,16 @@
|
||||
|^
|
||||
?- -.old
|
||||
%3
|
||||
:- cards
|
||||
:- (flop cards)
|
||||
this(-.state old, +.state (inflate-cache:ha old))
|
||||
::
|
||||
%2
|
||||
%_ $
|
||||
-.old %3
|
||||
cards :_(cards [%pass / %agent [our dap]:bowl %poke noun+!>(%fix-dangling)])
|
||||
::
|
||||
cards
|
||||
:_ cards
|
||||
[%pass / %agent [our dap]:bowl %poke noun+!>(%fix-dangling)]
|
||||
==
|
||||
|
||||
::
|
||||
@ -289,8 +292,7 @@
|
||||
==
|
||||
::
|
||||
++ fix-dangling
|
||||
=/ graphs=(set resource)
|
||||
get-keys:gra
|
||||
=/ graphs get-keys:gra
|
||||
:_ state
|
||||
%+ roll
|
||||
~(tap by unreads-each)
|
||||
@ -300,13 +302,12 @@
|
||||
?. ?=(%graph -.stats-index) out
|
||||
?. (~(has in graphs) graph.stats-index)
|
||||
:_(out (poke-us %remove-graph graph.stats-index))
|
||||
%+ weld out
|
||||
^- (list card)
|
||||
%+ welp out
|
||||
%+ turn
|
||||
^- (list index:graph-store)
|
||||
%+ skip
|
||||
`(list index:graph-store)`~(tap in indices)
|
||||
|=(=index:graph-store (check-node-existence:gra graph.stats-index index))
|
||||
~(tap in indices)
|
||||
|= =index:graph-store
|
||||
(check-node-existence:gra graph.stats-index index)
|
||||
|=(=index:graph-store (poke-us %read-each stats-index index))
|
||||
::
|
||||
++ poke-us
|
||||
|
Loading…
Reference in New Issue
Block a user