diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-12-17 16:33:25 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-12-17 16:33:25 +0100 |
commit | f2b5d9bacf8e109fe27cea8f68232d41fd3b3ea5 (patch) | |
tree | 6f56fe0013bc8cb43d53a162f030adbf797af850 /lib/App/ArchLinux/PackagerTools/Config.pm | |
parent | 20e07437f413e338f2b54447133e1533f5262c13 (diff) | |
download | App-ArchLinux-PackagerTools-f2b5d9bacf8e109fe27cea8f68232d41fd3b3ea5.tar.gz App-ArchLinux-PackagerTools-f2b5d9bacf8e109fe27cea8f68232d41fd3b3ea5.tar.xz |
Make context parameter explicit
This prevents a loop in $deps->{..}->{context} which is 1) unnecessary
and 2) potentially breaks memory recovery when things get deleted. Not
the case right now, but whatever.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib/App/ArchLinux/PackagerTools/Config.pm')
-rw-r--r-- | lib/App/ArchLinux/PackagerTools/Config.pm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/App/ArchLinux/PackagerTools/Config.pm b/lib/App/ArchLinux/PackagerTools/Config.pm index 470a1ae..a58e82d 100644 --- a/lib/App/ArchLinux/PackagerTools/Config.pm +++ b/lib/App/ArchLinux/PackagerTools/Config.pm @@ -32,17 +32,17 @@ Returns a new instance. =cut -method new($class: $deps = {}) { - return $class->new_no_defaults($deps); +method new($class: $context, $deps = {}) { + return $class->new_no_defaults($context, $deps); } -method new_no_defaults($class: $deps = {}) { - return $deps->{context}->{$class} if defined $deps->{context}->{$class}; +method new_no_defaults($class: $context, $deps = {}) { + return $context->{$class} if defined $context->{$class}; my $self = {}; bless $self, $class; $self->{deps} = $deps; - $deps->{context}->{$class} = $self; + $context->{$class} = $self; return $self; } |