Function: cider-xref--dedupe

cider-xref--dedupe is a byte-compiled function defined in cider-xref-source.el.

Signature

(cider-xref--dedupe ITEMS)

Documentation

Remove xref ITEMS that point at the same file, line and column.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-xref-source.el
(defun cider-xref--dedupe (items)
  "Remove xref ITEMS that point at the same file, line and column."
  (let ((seen (make-hash-table :test #'equal))
        result)
    (dolist (item items)
      (let* ((loc (xref-item-location item))
             (key (and (xref-file-location-p loc)
                       (list (xref-file-location-file loc)
                             (xref-file-location-line loc)
                             (xref-file-location-column loc)))))
        (when (or (null key) (not (gethash key seen)))
          (when key (puthash key t seen))
          (push item result))))
    (nreverse result)))