mirror of
https://github.com/urbit/shrub.git
synced 2024-12-25 04:52:06 +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
|
||||
|= [=graph:store nodes=(set index:store)]
|
||||
^- ?
|
||||
=/ has-duplicates %.n
|
||||
=/ node-list ~(tap in nodes)
|
||||
|-
|
||||
?~ node-list
|
||||
has-duplicates
|
||||
=. has-duplicates
|
||||
|(has-duplicates (has-node graph i.node-list))
|
||||
?~ node-list %.n
|
||||
?: (has-node graph i.node-list) %.y
|
||||
$(node-list t.node-list)
|
||||
::
|
||||
++ has-node
|
||||
|
Loading…
Reference in New Issue
Block a user