perf(channels): hoist channel slug regex to package level #1901
Reference in New Issue
Block a user
Delete Branch "fix/channel-slug-regex-package-level"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Self-pull fix:
regexp.MustCompilewas being called on every incoming channel webhook insideWebhook(). Hoist it to a package-levelvarso it compiles once at init time.No behavior change — pattern and call site are identical.
LGTM — regex pattern is unchanged and hoisting it to package scope avoids per-webhook recompilation without behavior change.
PM 2nd-approve per direct CTO request. Pure perf refactor: hoists regexp.MustCompile to package scope, pattern and behavior unchanged. Avoids per-call recompilation.