Function: ht-find

ht-find is a byte-compiled function defined in ht.el.

Signature

(ht-find FUNCTION TABLE)

Documentation

Return (key, value) from TABLE for which FUNCTION returns a truthy value.

Return nil otherwise.

FUNCTION is called with two arguments, KEY and VALUE.

Source Code

;; Defined in ~/.emacs.d/elpa/ht-20230703.558/ht.el
(defun ht-find (function table)
  "Return (key, value) from TABLE for which FUNCTION returns a truthy value.
Return nil otherwise.

FUNCTION is called with two arguments, KEY and VALUE."
  (catch 'break
    (ht-each
     (lambda (key value)
       (when (funcall function key value)
         (throw 'break (list key value))))
     table)))