Skip to content

Commit 89721c7

Browse files
committed
Remove inner instrument call, wrap everything in outer instrument
1 parent 91e9606 commit 89721c7

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

lib/github/ldap.rb

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -147,23 +147,20 @@ def load_group(group_entry)
147147
#
148148
# Returns an Array of Net::LDAP::Entry.
149149
def search(options, &block)
150-
result = if options[:base]
151-
instrument "github_ldap.search_base", options do
152-
@connection.search(options, &block)
153-
end
154-
else
155-
instrument "github_ldap.search_bases", options.dup do |payload|
156-
search_domains.each_with_object([]) do |base, result|
157-
instrument "github_ldap.search_base", payload.merge(:base => base) do
150+
instrument "github_ldap.search", options.dup do |payload|
151+
result =
152+
if options[:base]
153+
@connection.search(options, &block)
154+
else
155+
search_domains.each_with_object([]) do |base, result|
158156
rs = @connection.search(options.merge(:base => base), &block)
159157
result.concat Array(rs) unless rs == false
160158
end
161159
end
162-
end
163-
end
164160

165-
return [] if result == false
166-
Array(result)
161+
return [] if result == false
162+
Array(result)
163+
end
167164
end
168165

169166
# Internal - Determine whether to use encryption or not.

0 commit comments

Comments
 (0)