Skip to content

Commit

Permalink
Move hierarchy--set-equal to the helpers section
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienCassou committed Jun 12, 2017
1 parent 319509c commit 9bf9c77
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions hierarchy.el
Expand Up @@ -102,6 +102,17 @@ should be an item of the hierarchy."
(push item (map-elt (hierarchy--children hierarchy) parent (list)))
(map-put (hierarchy--parents hierarchy) item parent)))))

(defun hierarchy--set-equal (list1 list2 &rest cl-keys)
"Return non-nil if LIST1 and LIST2 have same elements.
I.e., if every element of LIST1 also appears in LIST2 and if
every element of LIST2 also appears in LIST1.
CL-KEYS are key-value pairs just like in `cl-subsetp'. Supported
keys are :key and :test."
(and (apply 'cl-subsetp list1 list2 cl-keys)
(apply 'cl-subsetp list2 list1 cl-keys)))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Creation
Expand Down Expand Up @@ -292,17 +303,6 @@ and either:
(hierarchy-child-p hierarchy item1 item2)
(hierarchy-descendant-p hierarchy (hierarchy-parent hierarchy item1) item2))))

(defun hierarchy--set-equal (list1 list2 &rest cl-keys)
"Return non-nil if LIST1 and LIST2 have same elements.
I.e., if every element of LIST1 also appears in LIST2 and if
every element of LIST2 also appears in LIST1.
CL-KEYS are key-value pairs just like in `cl-subsetp'. Supported
keys are :key and :test."
(and (apply 'cl-subsetp list1 list2 cl-keys)
(apply 'cl-subsetp list2 list1 cl-keys)))

(defun hierarchy-equal (hierarchy1 hierarchy2)
"Return t if HIERARCHY1 and HIERARCHY2 are equal.
Expand Down

0 comments on commit 9bf9c77

Please sign in to comment.