optimize inScope perf

This commit is contained in:
Umputun
2018-06-12 23:12:06 -05:00
parent 2a6fcac9b4
commit 3eddad87e8
+4 -4
View File
@@ -79,11 +79,11 @@ func (m *memoryCache) Flush(scopes ...string) {
// check if fullKey has matching scopes
inScope := func(fullKey string) bool {
_, keyScopes, err := ParseKey(fullKey)
if err != nil {
return false
}
for _, s := range scopes {
_, keyScopes, err := ParseKey(fullKey)
if err != nil {
return false
}
for _, ks := range keyScopes {
if ks == s {
return true