Commit 131b758a authored by Fabio Pelosin's avatar Fabio Pelosin

[Source] Fixed slowness.

parent 8f8e5409
......@@ -15,6 +15,7 @@
[#570](https://github.com/CocoaPods/CocoaPods/issues/570)
- Fixed a crash for `pod outdated`.
[#567](https://github.com/CocoaPods/CocoaPods/issues/567)
- Fixed an issue that lead to excessively slow sets computation.
## 0.15.0
......
......@@ -128,10 +128,22 @@ module Pod
# @return [Array<Set>] The sets for all the pods available.
#
# @note Implementation detail: The sources don't cache their values
# because they might change in response to an update. Therefore
# this method to prevent slowness caches the values before
# processing them.
#
def all_sets
all_pods.map do |pod|
sources = all.select{ |s| s.pods.include?(pod) }.compact
Specification::Set.new(pod, sources)
pods_by_source = {}
all.each do |source|
pods_by_source[source] = source.pods
end
sources = pods_by_source.keys
pods = pods_by_source.values.flatten.uniq
pods.map do |pod|
pod_sources = sources.select{ |s| pods_by_source[s].include?(pod) }.compact
Specification::Set.new(pod, pod_sources)
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment