You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Robert Nicholson <ro...@gmail.com> on 2007/02/11 15:07:28 UTC

Why are arguments ignored in the EvalTests.pm methods?

Can anybody tell me why the argument is passed for raw tests and then  
subsequently ignored later?

# generic test version
sub check_for_mime {
   my ($self, undef, $test) = @_;

   $self->_check_attachments unless exists $self->{$test};
   return $self->{$test};
}


for instance the body array goes into this but it's ignored.

Why is it done like that?

Since self includes the PMS everything can be later derived from that  
so i'm confused why
the callers pass in those arguments.

Re: Why are arguments ignored in the EvalTests.pm methods?

Posted by Theo Van Dinter <fe...@apache.org>.
On Sun, Feb 11, 2007 at 08:07:28AM -0600, Robert Nicholson wrote:
> Can anybody tell me why the argument is passed for raw tests and then  
> subsequently ignored later?

The argument is passed because it's a standard call for an eval rule, but the
eval code doesn't need the information.

> Since self includes the PMS everything can be later derived from that  
> so i'm confused why the callers pass in those arguments.

It's more efficient to prep the standard information once instead of having
each eval rule potentially have to generate the same information over and over
again.

-- 
Randomly Selected Tagline:
QOTD:
 	"You're so dumb you don't even have wisdom teeth."