class
Analyzer::Scala::Scalatra
Defined in:
analyzer/analyzers/scala/scalatra.crConstant Summary
-
HTTP_METHODS =
["get", "post", "put", "delete", "patch", "head", "options"] of ::String -
ROUTE_PATTERNS =
HTTP_METHODS.map do |method| {method, /(?<![.\w])#{method}\s*\(\s*"([^"]+)"/} end -
Crystal recompiles an interpolated regex literal on every evaluation (a full PCRE2 JIT compile), and this matcher used to be rebuilt for every verb on every line — precompile the fixed set once at load time.