Browse Source

capture variable in the loop - ffs

Mark deVilliers 2 years ago
parent
commit
9d3690e3d3
1 changed files with 2 additions and 3 deletions
  1. 2 3
      node/api/entitlement_store.go

+ 2 - 3
node/api/entitlement_store.go

@@ -83,9 +83,9 @@ func (e entitlementMap) FindForSubject(subject utils.Subject) (Entitlement, bool
83 83
 	// TODO : optimise optimise optimise - rewrite as a trie
84 84
 	for _, s := range perms {
85 85
 		for _, ent := range e.store {
86
-
87 86
 			if ent.Subject == s {
88
-				return ent, true
87
+				ffs := ent
88
+				return ffs, true
89 89
 			}
90 90
 		}
91 91
 	}
@@ -136,7 +136,6 @@ func (e entitlementMap) AppendOrReplaceOnSubject(ent Entitlement) {
136 136
 
137 137
 	if found {
138 138
 		ent.UID = existing.UID
139
-		ent.AccessLevel = existing.AccessLevel
140 139
 		e.store[existing.UID] = ent
141 140
 		return
142 141
 	}