diff --git a/AbuseFilter.parser.php b/AbuseFilter.parser.php index ea907a19e..d3ab5493b 100644 --- a/AbuseFilter.parser.php +++ b/AbuseFilter.parser.php @@ -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; }