Skip to content

Commit

Permalink
[NativeTarget] Make adding a target dependency O(1).
Browse files Browse the repository at this point in the history
This greatly reduces the amount of time taken for large Podfiles.
  • Loading branch information
alloy committed Oct 28, 2014
1 parent e79387f commit fb2ea87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/xcodeproj/project/object/native_target.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def shell_script_build_phases
def add_dependency(target)
unless dependency_for_target(target)
container_proxy = project.new(Xcodeproj::Project::PBXContainerItemProxy)
if target.project == project
if target.project.shallow_eql?(project)
container_proxy.container_portal = project.root_object.uuid
else
subproject_reference = project.reference_for_path(target.project.path)
Expand All @@ -209,7 +209,7 @@ def add_dependency(target)

dependency = project.new(Xcodeproj::Project::PBXTargetDependency)
dependency.name = target.name
dependency.target = target if target.project == project
dependency.target = target if target.project.shallow_eql?(project)
dependency.target_proxy = container_proxy

dependencies << dependency
Expand Down

1 comment on commit fb2ea87

@fabiopelosin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥

Please sign in to comment.