summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-03-05 05:56:39 +0100
committerGitHub <noreply@github.com>2018-03-05 05:56:39 +0100
commitf19ca3cf1d7cae69c0419a16d2847f46baf2a287 (patch)
tree651eae0167358200468764000c2db2fc494caece /Bugzilla
parent4dc8fc6b31aeb1ee357be87d900abdec0bc0ddf7 (diff)
downloadbugzilla-f19ca3cf1d7cae69c0419a16d2847f46baf2a287.tar.gz
bugzilla-f19ca3cf1d7cae69c0419a16d2847f46baf2a287.tar.xz
Backport 1136125 to bmo - Reduce memory usage of Bugzilla::CGI->send_cookie()
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/CGI.pm19
1 files changed, 2 insertions, 17 deletions
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm
index 41b418f6a..3906156c4 100644
--- a/Bugzilla/CGI.pm
+++ b/Bugzilla/CGI.pm
@@ -661,16 +661,7 @@ sub should_set {
# pass them around to all of the callers. Instead, store them locally here,
# and then output as required from |header|.
sub send_cookie {
- my $self = shift;
-
- # Move the param list into a hash for easier handling.
- my %paramhash;
- my @paramlist;
- my ($key, $value);
- while ($key = shift) {
- $value = shift;
- $paramhash{$key} = $value;
- }
+ my ($self, %paramhash) = @_;
# Complain if -value is not given or empty (bug 268146).
if (!exists($paramhash{'-value'}) || !$paramhash{'-value'}) {
@@ -684,13 +675,7 @@ sub send_cookie {
$paramhash{'-secure'} = 1
if lc( $uri->scheme ) eq 'https';
-
- # Move the param list back into an array for the call to cookie().
- foreach (keys(%paramhash)) {
- unshift(@paramlist, $_ => $paramhash{$_});
- }
-
- push(@{$self->{'Bugzilla_cookie_list'}}, $self->cookie(@paramlist));
+ push(@{$self->{'Bugzilla_cookie_list'}}, $self->cookie(%paramhash));
}
# Cookies are removed by setting an expiry date in the past.