mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 13:54:20 +03:00
graph-store: %node-siblings fixed
This commit is contained in:
parent
d27a26ec31
commit
82b668cf3a
@ -281,7 +281,8 @@
|
|||||||
(~(put in validators) u.mark)
|
(~(put in validators) u.mark)
|
||||||
==
|
==
|
||||||
%- zing
|
%- zing
|
||||||
:~ (give [/updates /keys ~] [%add-graph resource graph mark overwrite])
|
:~ (give [/keys ~] %keys ~(key by graphs))
|
||||||
|
(give [/updates ~] %add-graph resource *graph:store mark overwrite)
|
||||||
clay-backup
|
clay-backup
|
||||||
?~ mark ~
|
?~ mark ~
|
||||||
?: (~(has in validators) u.mark) ~
|
?: (~(has in validators) u.mark) ~
|
||||||
@ -887,8 +888,10 @@
|
|||||||
:+ %add-nodes
|
:+ %add-nodes
|
||||||
[ship term]
|
[ship term]
|
||||||
%- ~(gas by *(map index:store node:store))
|
%- ~(gas by *(map index:store node:store))
|
||||||
%+ turn
|
:: TODO time complexity not desirable
|
||||||
=- ?:(older (slag (sub (lent -) count) -) (scag count -))
|
:: replace with custom ordered map functions
|
||||||
|
%+ turn
|
||||||
|
=- ?.(older (slag (safe-sub (lent -) count) -) (scag count -))
|
||||||
%- tap:orm
|
%- tap:orm
|
||||||
%+ subset:orm u.graph
|
%+ subset:orm u.graph
|
||||||
=/ idx
|
=/ idx
|
||||||
@ -978,6 +981,14 @@
|
|||||||
(peek:orm-log:store update-log)
|
(peek:orm-log:store update-log)
|
||||||
(bind result |=([=time update:store] time))
|
(bind result |=([=time update:store] time))
|
||||||
==
|
==
|
||||||
|
::
|
||||||
|
++ safe-sub
|
||||||
|
|= [a=@ b=@]
|
||||||
|
^- @
|
||||||
|
?: (gte b a)
|
||||||
|
0
|
||||||
|
(sub a b)
|
||||||
|
::
|
||||||
++ get-node-children
|
++ get-node-children
|
||||||
|= [=ship =term =index:store]
|
|= [=ship =term =index:store]
|
||||||
^- (unit graph:store)
|
^- (unit graph:store)
|
||||||
|
Loading…
Reference in New Issue
Block a user