From 387608caac85ccf6c0782572420ecbdae4e301bf Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 19 Dec 2012 16:56:47 +0800 Subject: Bug 815532: Add caching for Bugzilla::User objects r=dkl,a=LpSolit --- Bugzilla/Attachment.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Bugzilla/Attachment.pm') diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index 3dbd4ce6d..3678424c9 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -190,9 +190,8 @@ the user who attached the attachment sub attacher { my $self = shift; - return $self->{attacher} if exists $self->{attacher}; - $self->{attacher} = new Bugzilla::User($self->{submitter_id}); - return $self->{attacher}; + return $self->{attacher} + ||= new Bugzilla::User({ id => $self->{submitter_id}, cache => 1 }); } =over -- cgit v1.2.3-24-g4f1b