Commit c5fb55b4 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 897029: Preload bug permissions when calling Bug.get to improve performance

r/a=sgreen
parent 6fd9f0a3
......@@ -323,6 +323,12 @@ sub get {
my @bugs;
my @faults;
# Cache permissions for bugs. This highly reduces the number of calls to the DB.
# visible_bugs() is only able to handle bug IDs, so we have to skip aliases.
my @int = grep { $_ =~ /^\d+$/ } @$ids;
Bugzilla->user->visible_bugs(\@int);
foreach my $bug_id (@$ids) {
my $bug;
if ($params->{permissive}) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment