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

[Source] Fixed slowness.

parent 8f8e5409
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
[#570](https://github.com/CocoaPods/CocoaPods/issues/570) [#570](https://github.com/CocoaPods/CocoaPods/issues/570)
- Fixed a crash for `pod outdated`. - Fixed a crash for `pod outdated`.
[#567](https://github.com/CocoaPods/CocoaPods/issues/567) [#567](https://github.com/CocoaPods/CocoaPods/issues/567)
- Fixed an issue that lead to excessively slow sets computation.
## 0.15.0 ## 0.15.0
......
...@@ -128,10 +128,22 @@ module Pod ...@@ -128,10 +128,22 @@ module Pod
# @return [Array<Set>] The sets for all the pods available. # @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 def all_sets
all_pods.map do |pod| pods_by_source = {}
sources = all.select{ |s| s.pods.include?(pod) }.compact all.each do |source|
Specification::Set.new(pod, sources) 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
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