diff --git a/extra/semantic-db/hierarchy/hierarchy.factor b/extra/semantic-db/hierarchy/hierarchy.factor index 7d5f976909..7465d67664 100644 --- a/extra/semantic-db/hierarchy/hierarchy.factor +++ b/extra/semantic-db/hierarchy/hierarchy.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Alex Chapman ! See http://factorcode.org/license.txt for BSD license. -USING: accessors db.tuples kernel new-slots semantic-db -semantic-db.relations sorting sequences sequences.deep ; +USING: accessors db.tuples hashtables kernel new-slots +semantic-db semantic-db.relations sorting sequences ; IN: semantic-db.hierarchy TUPLE: tree id children ; @@ -34,9 +34,6 @@ C: tree : get-node-hierarchy ( node-id -- tree ) dup children [ get-node-hierarchy ] map ; -: uniq ( sorted-seq -- seq ) - f swap [ tuck = not ] subset nip ; - : (get-root-nodes) ( node-id -- root-nodes/node-id ) dup parents dup empty? [ drop @@ -45,4 +42,4 @@ C: tree ] if ; : get-root-nodes ( node-id -- root-nodes ) - (get-root-nodes) flatten natural-sort uniq ; + (get-root-nodes) flatten prune ;