From fb85e2ee8fc510a607f60525f8c3b3978a9789df Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 20 Oct 2010 02:27:59 +0200 Subject: Bug 553266: config.cgi?ctype=rdf spends most of its time loading flagtypes from the database a=LpSolit (module owner) --- Bugzilla/Component.pm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'Bugzilla/Component.pm') diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm index 2a176f5dc..dc3cc1b9e 100644 --- a/Bugzilla/Component.pm +++ b/Bugzilla/Component.pm @@ -374,16 +374,14 @@ sub flag_types { my $self = shift; if (!defined $self->{'flag_types'}) { + my $flagtypes = Bugzilla::FlagType::match({ product_id => $self->product_id, + component_id => $self->id }); + $self->{'flag_types'} = {}; $self->{'flag_types'}->{'bug'} = - Bugzilla::FlagType::match({ 'target_type' => 'bug', - 'product_id' => $self->product_id, - 'component_id' => $self->id }); - + [grep { $_->target_type eq 'bug' } @$flagtypes]; $self->{'flag_types'}->{'attachment'} = - Bugzilla::FlagType::match({ 'target_type' => 'attachment', - 'product_id' => $self->product_id, - 'component_id' => $self->id }); + [grep { $_->target_type eq 'attachment' } @$flagtypes]; } return $self->{'flag_types'}; } -- cgit v1.2.3-24-g4f1b