Skip to content

Commit 909da53

Browse files
committed
Doc, reorder variables to make purpose explicit
1 parent cb4bd2c commit 909da53

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/github/ldap/member_search/recursive.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ def initialize(ldap, options = {})
3434
#
3535
# Returns Array of Net::LDAP::Entry objects.
3636
def perform(group)
37-
found = Hash.new
37+
# track groups found
38+
found = Hash.new
39+
40+
# track DNs searched for (so we don't repeat searches)
3841
searched = []
39-
entries = []
4042

4143
# if this is a posixGroup, return members immediately (no nesting)
4244
uids = member_uids(group)
@@ -89,6 +91,9 @@ def perform(group)
8991
end
9092
end
9193

94+
# entries to return
95+
entries = []
96+
9297
# pull member DNs, discarding dupes and subgroup DNs
9398
member_dns = found.values.each_with_object([]) do |group, member_dns|
9499
entries << group

0 commit comments

Comments
 (0)