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:
parent
ac136dab08
commit
803584dc7c
1 changed files with 2 additions and 2 deletions
|
|
@ -161,8 +161,8 @@
|
||||||
(def ^:no-doc ^:dynamic *escape-?* true)
|
(def ^:no-doc ^:dynamic *escape-?* true)
|
||||||
|
|
||||||
;; suspicious entity names:
|
;; suspicious entity names:
|
||||||
(def ^:private suspicious #";")
|
(def ^:private suspicious ";")
|
||||||
(defn- suspicious? [s] (boolean (re-find suspicious s)))
|
(defn- suspicious? [s] (str/includes? s suspicious))
|
||||||
(defn- suspicious-entity-check [entity]
|
(defn- suspicious-entity-check [entity]
|
||||||
(when-not *allow-suspicious-entities*
|
(when-not *allow-suspicious-entities*
|
||||||
(when (suspicious? entity)
|
(when (suspicious? entity)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue