From: Frédéric Buclin Date: Wed, 20 Oct 2010 00:33:33 +0000 (+0200) Subject: Bug 553266: config.cgi?ctype=rdf spends most of its time loading flagtypes from the... X-Git-Tag: bugzilla-3.6.3~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b84465752a77f4b4c07752c1b8783e086a14500a;p=thirdparty%2Fbugzilla.git Bug 553266: config.cgi?ctype=rdf spends most of its time loading flagtypes from the database (partial backport) a=LpSolit (module owner) --- diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm index 194a3957c7..dda599b52f 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'}; }