mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
Merge "Optimize loop in 'diff-split' case"
This commit is contained in:
commit
f0ae0ec101
|
@ -179,8 +179,8 @@ class LazyVariableComputer {
|
|||
$diff_lines = explode( "\n", $diff );
|
||||
$result = [];
|
||||
foreach ( $diff_lines as $line ) {
|
||||
if ( substr( $line, 0, 1 ) === $line_prefix ) {
|
||||
$result[] = substr( $line, strlen( $line_prefix ) );
|
||||
if ( ( $line[0] ?? '' ) === $line_prefix ) {
|
||||
$result[] = substr( $line, 1 );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue