automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FYI: simplify variable_not_always_defined_in_cond


From: Raja R Harinath
Subject: Re: FYI: simplify variable_not_always_defined_in_cond
Date: Wed, 20 Nov 2002 15:04:01 -0600
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

Hi,

Alexandre Duret-Lutz <address@hidden> writes:
[snip]
> +sub sub_conditions ($$)
> +{
> +  my ($self, $subcond) = @_;
> +  my @res;
> +
> +  # Make $subcond blindingly apparent in the ConditionalSet.
> +  my $prod = $self->_multiply ($subcond);

Neat!!!

> +  # Now, strip $subcond from the non-false Conditionals.
> +  foreach my $c ($prod->conds)
> +    {
> +      if (! $c->false)
> +     {
> +       my @rescond;
> +       foreach my $cc ($c->conds)
> +         {
> +           push @rescond, $cc
> +             unless $subcond->has ($cc);
> +         }

The inner loop can become A::C::strip, as a counterpart to
A::C::merge.

> +       push @res, new Automake::Conditional @rescond;

This would simplify to

  push @res, $c->strip($subcond)
    if (! $c->false);

No need for the comment on top of the loop.

- Hari
-- 
Raja R Harinath ------------------------------ address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]