On 2021-Jul-27, Dagfinn Ilmari Mannsåker wrote:
> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> > + if (grep { $_ eq $ref} @{ $self->{references} } == 0)
>
> I disagree. Using grep in boolean context is perfectly idiomatic perl.
> What would be more idiomatic is List::Util::any, but that's not availble
> without upgrading List::Util from CPAN on Perls older than 5.20, so we
> can't use that.
I was wondering if instead of grepping the whole list for each addition
it would make sense to push always, and do a unique-ification step at
the end.
--
Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/