From 30a7f068b750be13678b2aeb31b9b3379e0609ec Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Wed, 20 Oct 2021 12:52:34 -0400 Subject: [PATCH] AttributeSet helper: skip wantarray --- src/lib/Hydra/Helper/AttributeSet.pm | 2 +- t/Helper/attributeset.t | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/Hydra/Helper/AttributeSet.pm b/src/lib/Hydra/Helper/AttributeSet.pm index b750d6e1..21966394 100644 --- a/src/lib/Hydra/Helper/AttributeSet.pm +++ b/src/lib/Hydra/Helper/AttributeSet.pm @@ -50,7 +50,7 @@ sub splitPath { sub enumerate { my ($self) = @_; my @paths = sort { length($a) <=> length($b) } @{$self->{"paths"}}; - return wantarray ? @paths : \@paths; + return @paths; } 1; diff --git a/t/Helper/attributeset.t b/t/Helper/attributeset.t index 273417bf..9c6c7b02 100644 --- a/t/Helper/attributeset.t +++ b/t/Helper/attributeset.t @@ -31,8 +31,9 @@ $attrs->registerValue("foo"); $attrs->registerValue("bar.baz.tux"); $attrs->registerValue("bar.baz.bux.foo.bar.baz"); +my @enumerated = $attrs->enumerate(); is( - \@{$attrs->enumerate()}, + \@enumerated, [ # "foo": skipped since we're registering values, and we # only want to track nested attribute sets.