chickadee » heap » heap-key

heap-key heap datumprocedure

Find the key, given the datum.

heap
The heap in which to search
datum
The datum whose key to find
(define (heap-key heap datum)
  (let ((index (heap-index heap datum)))
    (and index (element-key (heap-ref heap index)))))