Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove a useless query

  • Loading branch information...
commit 021d72b56bdf31bda1573e9448f2b4b95e656c91 1 parent 6da4b1b
@franckcuny franckcuny authored
Showing with 9 additions and 7 deletions.
  1. +9 −7 lib/CPANHQ/Controller/Distribution.pm
View
16 lib/CPANHQ/Controller/Distribution.pm
@@ -50,22 +50,24 @@ sub show : Chained(instance) : PathPart('') : Args(0) {
my $latest = $dist->latest_release;
$latest->_process_meta_yml();
- my $deps
- = $c->model('DB::Requires')
- ->search( { dist_from => $latest->distribution->id } );
-
my $graph = Graph::Easy->new();
- while ( my $dep = $deps->next ) {
+
+ my $uses = $dist->uses;
+ my $dist_uses;
+ while ( my $use = $uses->next ) {
+ my $name = $use->dist_to->name;
+ push @$dist_uses, $name;
$graph->add_edge(
$latest->distribution->name,
- $dep->dist_to->distribution->name
+ $name,
);
}
my $graph_output = $graph->as_ascii();
$c->stash(
release => $latest,
title => $latest->name,
- graph => $graph_output
+ graph => $graph_output,
+ uses => $dist_uses,
);
}
Please sign in to comment.
Something went wrong with that request. Please try again.