chore(perf): Pre-allocate where possible (enable prealloc linter) (#88952)
* chore(perf): Pre-allocate where possible (enable prealloc linter) Signed-off-by: Dave Henderson <dave.henderson@grafana.com> * fix TestAlertManagers_buildRedactedAMs Signed-off-by: Dave Henderson <dave.henderson@grafana.com> * prealloc a slice that appeared after rebase Signed-off-by: Dave Henderson <dave.henderson@grafana.com> --------- Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
This commit is contained in:
@@ -435,8 +435,10 @@ func (f *accessControlDashboardPermissionFilter) nestedFoldersSelectors(permSele
|
||||
}
|
||||
|
||||
func getAllowedUIDs(action string, user identity.Requester, scopePrefix string) []any {
|
||||
var args []any
|
||||
for _, uidScope := range user.GetPermissions()[action] {
|
||||
uidScopes := user.GetPermissions()[action]
|
||||
|
||||
args := make([]any, 0, len(uidScopes))
|
||||
for _, uidScope := range uidScopes {
|
||||
if !strings.HasPrefix(uidScope, scopePrefix) {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user