mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-10 18:21:34 +03:00
graph-store: no need to iterate through whole list if we find a single duplicate
This commit is contained in:
parent
78cf4443c2
commit
386997475b
@ -316,13 +316,10 @@
|
|||||||
++ check-for-duplicates
|
++ check-for-duplicates
|
||||||
|= [=graph:store nodes=(set index:store)]
|
|= [=graph:store nodes=(set index:store)]
|
||||||
^- ?
|
^- ?
|
||||||
=/ has-duplicates %.n
|
|
||||||
=/ node-list ~(tap in nodes)
|
=/ node-list ~(tap in nodes)
|
||||||
|-
|
|-
|
||||||
?~ node-list
|
?~ node-list %.n
|
||||||
has-duplicates
|
?: (has-node graph i.node-list) %.y
|
||||||
=. has-duplicates
|
|
||||||
|(has-duplicates (has-node graph i.node-list))
|
|
||||||
$(node-list t.node-list)
|
$(node-list t.node-list)
|
||||||
::
|
::
|
||||||
++ has-node
|
++ has-node
|
||||||
|
Loading…
Reference in New Issue
Block a user