Skip to content

Commit

Permalink
simplify logic in add_handled_dependencies to not use extra var
Browse files Browse the repository at this point in the history
  • Loading branch information
judocode committed Jan 23, 2025
1 parent 2a22d94 commit 6894a8d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions updater/lib/dependabot/dependency_snapshot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,10 @@ def mark_group_handled(group)
sig { params(dependency_names: T.any(String, T::Array[String])).void }
def add_handled_dependencies(dependency_names)
assert_current_directory_set!
set = @handled_dependencies[@current_directory] || Set.new
@handled_dependencies[@current_directory] ||= Set.new
names = Array(dependency_names)
Dependabot.logger.info("Adding dependencies as handled: (#{names.join(', ')}).")
set += names
@handled_dependencies[@current_directory] = set
@handled_dependencies[@current_directory] += names
end

sig { returns(T::Set[String]) }
Expand Down

0 comments on commit 6894a8d

Please sign in to comment.