Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to lockfile to retrieve spec repo for pod name #434

Merged
merged 2 commits into from
Mar 6, 2018

Conversation

dnkoutso
Copy link
Contributor

No description provided.

#
def spec_repo(pod_name)
pods_by_spec_repo.detect { |key, values| break key if values.include?(pod_name) }
end
Copy link
Member

Choose a reason for hiding this comment

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

Should this be cached/memoized in an internal hash? Since CocoaPods/CocoaPods#7464 will use this in a loop, it will end up traversing several times

Copy link
Contributor Author

@dnkoutso dnkoutso Feb 27, 2018

Choose a reason for hiding this comment

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

I dont think its that much of a problem. The maximum number of times spec_repo method can be called by CocoaPods library is N where N is the number of pods you have and it means that every single one changed its source for this method to be invoked.

I think N ranges from 1-200 here.

Definitely thanks for bringing up as performance can easily degrade on seemingly small changes :)

@segiddins
Copy link
Member

Updated to cache the inverted hash

@dnkoutso dnkoutso merged commit 57db34d into CocoaPods:master Mar 6, 2018
@dnkoutso dnkoutso deleted the change_sources_message branch March 6, 2018 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants