summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Component.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-07-10 19:37:55 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-07-10 19:37:55 +0200
commit41cbe22c70d6e0299eacc0a09b68b8d1a52c17a4 (patch)
treec8bb5a5c0b12293eaa00fcdf60515fe33ccc39cd /Bugzilla/Component.pm
parentb1a8bc55f2b5822405866bf4419f6b9cb49dd503 (diff)
downloadbugzilla-41cbe22c70d6e0299eacc0a09b68b8d1a52c17a4.tar.gz
bugzilla-41cbe22c70d6e0299eacc0a09b68b8d1a52c17a4.tar.xz
Bug 822980 - backport bug 815532 to bmo (Bugzilla::User objects should be cached where appropriate)
r=glob
Diffstat (limited to 'Bugzilla/Component.pm')
-rw-r--r--Bugzilla/Component.pm14
1 files changed, 6 insertions, 8 deletions
diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm
index ad5166a0f..0fe6fb25a 100644
--- a/Bugzilla/Component.pm
+++ b/Bugzilla/Component.pm
@@ -352,20 +352,18 @@ sub bug_ids {
sub default_assignee {
my $self = shift;
-
- if (!defined $self->{'default_assignee'}) {
- $self->{'default_assignee'} =
- new Bugzilla::User($self->{'initialowner'});
- }
- return $self->{'default_assignee'};
+ return $self->{'default_assignee'}
+ ||= new Bugzilla::User({ id => $self->{'initialowner'}, cache => 1 });
}
sub default_qa_contact {
my $self = shift;
if (!defined $self->{'default_qa_contact'}) {
- $self->{'default_qa_contact'} =
- new Bugzilla::User($self->{'initialqacontact'});
+ my $params = $self->{'initialqacontact'}
+ ? { id => $self->{'initialqacontact'}, cache => 1 }
+ : $self->{'initialqacontact'};
+ $self->{'default_qa_contact'} = new Bugzilla::User($params);
}
return $self->{'default_qa_contact'};
}