Skip to content

Commit

Permalink
[api] save 6 seconds in listing all packages of factory
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Oct 9, 2012
1 parent 8b3c4c1 commit 2fa11fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/controllers/source_controller.rb
Expand Up @@ -115,7 +115,7 @@ def index_project
packages = packages.sort{|a,b| a.name<=>b.name}
output = String.new
output << "<directory count='#{packages.length}'>\n"
output << packages.map { |p| p.db_project==pro ? " <entry name=\"#{p.name}\"/>\n" : " <entry name=\"#{p.name}\" originproject=\"#{p.db_project.name}\"/>\n" }.join
output << packages.map { |p| p.db_project_id==pro.id ? " <entry name=\"#{p.name}\"/>\n" : " <entry name=\"#{p.name}\" originproject=\"#{p.db_project.name}\"/>\n" }.join
output << "</directory>\n"
render :text => output, :content_type => "text/xml"
end
Expand Down

0 comments on commit 2fa11fa

Please sign in to comment.