Function: treesit-fold--count-matches

treesit-fold--count-matches is a natively compiled function defined in treesit-fold-util.el.

Signature

(treesit-fold--count-matches PATTERN STR)

Documentation

Count occurrences of PATTERN in STR.

Like function s-count-matches but faster.

Source Code

;; Defined in /nix/store/mpy1l6b4hlzpp59l4vbahq83hqa821ci-emacs-packages-deps/share/emacs/site-lisp/elpa/treesit-fold-0.2.1/treesit-fold-util.el
(defun treesit-fold--count-matches (pattern str)
  "Count occurrences of PATTERN in STR.

Like function `s-count-matches' but faster."
  (max 0 (1- (length (split-string str pattern)))))