mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-09-24 10:48:17 +00:00
Minor removal of duplicate code within the AF parser
Change-Id: I4e318028c2c623f77f1615971090eb06fc21f2d3
This commit is contained in:
parent
37d05a77d3
commit
fc5ef1666b
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue