More efficient check for suspicious entities

re-find sets up the regex machinery which is unnecessary here. str/includes? of
a single character is more efficient.
This commit is contained in:
Oleksandr Yakushev 2024-09-27 09:58:54 +03:00
parent ac136dab08
commit 803584dc7c

View file

@ -161,8 +161,8 @@
(def ^:no-doc ^:dynamic *escape-?* true)
;; suspicious entity names:
(def ^:private suspicious #";")
(defn- suspicious? [s] (boolean (re-find suspicious s)))
(def ^:private suspicious ";")
(defn- suspicious? [s] (str/includes? s suspicious))
(defn- suspicious-entity-check [entity]
(when-not *allow-suspicious-entities*
(when (suspicious? entity)