diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2010-10-20 02:27:59 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2010-10-20 02:27:59 +0200 |
commit | fb85e2ee8fc510a607f60525f8c3b3978a9789df (patch) | |
tree | a8a0458b6537087ff15a40924788e5200089e257 /Bugzilla/Component.pm | |
parent | 956e50863d553ed397f15c4c640d07aecf4c8cc5 (diff) | |
download | bugzilla-fb85e2ee8fc510a607f60525f8c3b3978a9789df.tar.gz bugzilla-fb85e2ee8fc510a607f60525f8c3b3978a9789df.tar.xz |
Bug 553266: config.cgi?ctype=rdf spends most of its time loading flagtypes from the database
a=LpSolit (module owner)
Diffstat (limited to 'Bugzilla/Component.pm')
-rw-r--r-- | Bugzilla/Component.pm | 12 |
1 files changed, 5 insertions, 7 deletions
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'}; } |