Skip to content

Commit 52654ad

Browse files
committed
Short circuit after filtering out already searched DNs
1 parent 09e05a6 commit 52654ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/github/ldap/member_search/recursive.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ def perform(group)
6969
sub_dns.concat member_dns(subgroup)
7070
end
7171

72-
# give up if there's nothing else to search for
73-
break if sub_dns.empty?
74-
7572
# filter out if already searched for
7673
sub_dns.reject! { |dn| searched.include?(dn) }
7774

75+
# give up if there's nothing else to search for
76+
break if sub_dns.empty?
77+
7878
# search for subgroups
7979
subgroups = sub_dns.each_with_object([]) do |dn, subgroups|
8080
subgroups.concat ldap.search(base: dn, scope: Net::LDAP::SearchScope_BaseObject, attributes: attrs, filter: filter)

0 commit comments

Comments
 (0)