Skip to content

Commit

Permalink
CodeQL fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Riku Virtanen committed Mar 1, 2024
1 parent 0d23233 commit 4a4536d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,8 @@ private void DeleteTestUsers(string userDn, string groupDn)

LdapAttribute memberAttr = groupEntry.GetAttribute("member");
var currentMembers = memberAttr.StringValueArray;
foreach (var member in currentMembers)
{
if (member == userDn)
remove = true;
}
if (currentMembers.Where(e => e == userDn).Any())
remove = true;

if (remove)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private static bool UserExistsInGroup(LdapConnection connection, string userDn,
{
LdapAttribute memberAttr = entry.GetAttribute("member");
var currentMembers = memberAttr.StringValueArray;
foreach (var member in currentMembers.Where(e => e == userDn))
if (currentMembers.Where(e => e == userDn).Any())
return true;
}
}
Expand Down

0 comments on commit 4a4536d

Please sign in to comment.