summaryrefslogtreecommitdiff
path: root/internal/cache
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-05-21 13:20:19 +0000
committerLibravatar GitHub <noreply@github.com>2024-05-21 14:20:19 +0100
commitb092da6d281a437c3f847e655c4ad182decb0978 (patch)
treecd5dcc7bebb055cd1b1714fa7b41362a44fdb788 /internal/cache
parent[chore] dependabot updates (#2922) (diff)
downloadgotosocial-b092da6d281a437c3f847e655c4ad182decb0978.tar.xz
[performance] cache v2 filter keyword regular expressions (#2903)
* add caching of filterkeyword regular expressions * formatting * fix WholeWord nil check
Diffstat (limited to 'internal/cache')
-rw-r--r--internal/cache/db.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/cache/db.go b/internal/cache/db.go
index 4ce541770..16bd10eaa 100644
--- a/internal/cache/db.go
+++ b/internal/cache/db.go
@@ -531,6 +531,11 @@ func (c *Caches) initFilterKeyword() {
// See internal/db/bundb/filter.go.
filterKeyword2.Filter = nil
+ // We specifically DO NOT unset
+ // the regexp field here, as any
+ // regexp.Regexp instance is safe
+ // for concurrent access.
+
return filterKeyword2
}