Project

General

Profile

« Previous | Next » 

Revision e0910b7e

Added by Michael Moll almost 6 years ago

Fixes #23857 - Fix Performance/InefficientHashSearch cop

View differences:

app/models/auth_sources/auth_source_ldap.rb
def attributes_values(entry)
Hash[required_ldap_attributes.merge(optional_ldap_attributes).map do |name, value|
next if value.blank? || (entry[value].blank? && optional_ldap_attributes.keys.include?(name))
next if value.blank? || (entry[value].blank? && optional_ldap_attributes.key?(name))
if name.eql? :avatar
[:avatar_hash, store_avatar(entry[value].first)]
else

Also available in: Unified diff