wiki.techinc.nl/includes/parser
C. Scott Ananian ad89079a44 Avoid counting input lines twice in BlockLevelPass::execute()
In T208070 / I120ca25a77b7b933de4afddd1d458e36a95e26da we added a
check whether we were processing the last line of input, in order
to avoid emitting extra trailing newlines.  But if the number of
input lines is large, StringUtils::explode() will return an
iterator which doesn't implement Countable for efficiency.
I22eebb70af1b19d7c25241fc78bfcced4470e78a fixed this, but at the
cost of scanning the string twice: once just to count the number
of newlines before we begin to iterate over the lines.

This patch uses Iterator::valid() to determine if we're on the
last iteration without having to scan the string twice.

Bug: T208070
Bug: T218817
Change-Id: I41a45266d266195aa6002d3854e018cacf052ca6
2019-03-20 17:35:14 -04:00
..
BlockLevelPass.php Avoid counting input lines twice in BlockLevelPass::execute() 2019-03-20 17:35:14 -04:00
CacheTime.php ParserOutput::getCacheTime should stay the same after the first call. 2018-10-04 13:08:56 +02:00
CoreParserFunctions.php Remove comments literally repeating the next line of code 2019-02-27 17:28:40 +00:00
CoreTagHooks.php Start working on phan-taint-check warnings. Fix minor escaping issues. 2018-07-12 03:26:59 +00:00
DateFormatter.php Use PHP 7 '??' operator instead of if-then-else 2018-10-21 21:46:46 +02:00
LinkHolderArray.php Various fixes for phan-taint-check 2019-02-17 11:41:11 +00:00
MWTidy.php Remove most support for configuring Tidy, including Raggett 2018-11-15 12:22:06 -05:00
Parser.php Remove $wgMediaInTargetLanguage 2019-03-08 15:24:39 -08:00
ParserCache.php Avoid using outdated $casToken field for BagOStuff calls 2019-03-11 23:39:29 -07:00
ParserDiffTest.php Get rid of call_user_func(_array)(), part 3 2018-06-10 02:21:24 +00:00
ParserFactory.php Inject Config into Parser instead of using globals 2018-10-02 21:26:01 +03:00
ParserOptions.php Remove deprecated ParserOutput::legacyOptions 2019-03-11 22:50:47 -07:00
ParserOutput.php Use short assignment operator in PHP 2019-03-07 09:55:49 +01:00
Preprocessor.php Use PHP 5.6 constant expressions for some bitfield constants 2018-05-30 18:05:18 -07:00
Preprocessor_DOM.php Safe replacement of a lot of !count() with === [] 2019-01-15 17:28:49 +01:00
Preprocessor_Hash.php Use PHP 7 '??' operator instead of if-then-else 2018-10-21 21:46:46 +02:00
RemexStripTagHandler.php Improve RemexStripTagHandler working with tables 2019-03-14 13:11:59 -07:00
Sanitizer.php Sanitizer: remove deprecated parameter to escapeIdReferenceList() 2019-02-21 20:12:22 -08:00
StripState.php Normalize PHPDoc attributes 2018-03-16 22:59:15 -07:00