Minor removal of duplicate code within the AF parser

Change-Id: I4e318028c2c623f77f1615971090eb06fc21f2d3
This commit is contained in:
Marius Hoch 2012-12-20 02:34:28 +01:00
parent 37d05a77d3
commit fc5ef1666b

View file

@ -1014,24 +1014,14 @@ class AbuseFilterParser {
$this->move();
$r2 = new AFPData();
if ( $op == '&' && !( $result->toBool() ) ) {
// We can go on quickly as either one statement with | is true or on with & is false
if ( ( $op == '&' && !$result->toBool() ) || ( $op == '|' && $result->toBool() ) ) {
wfProfileIn( __METHOD__ . '-shortcircuit' );
$orig = $this->mShortCircuit;
$this->mShortCircuit = $this->mAllowShort;
$this->doLevelCompares( $r2 );
$this->mShortCircuit = $orig;
$result = new AFPData( AFPData::DBool, false );
wfProfileOut( __METHOD__ . '-shortcircuit' );
continue;
}
if ( $op == '|' && $result->toBool() ) {
wfProfileIn( __METHOD__ . '-shortcircuit' );
$orig = $this->mShortCircuit;
$this->mShortCircuit = $this->mAllowShort;
$this->doLevelCompares( $r2 );
$this->mShortCircuit = $orig;
$result = new AFPData( AFPData::DBool, true );
$result = new AFPData( AFPData::DBool, $result->toBool() );
wfProfileOut( __METHOD__ . '-shortcircuit' );
continue;
}