Go to file
Bartosz Dziewoński 5fc30112c7 Optimize 'count()' function
substr_count() is just as fast as looped strpos() when there are no
matches, and gets faster as the number of matches increases.

Note that this introduces a small change in behavior when the needle
is composed of repeated substrings, e.g. 'asdasdasd' or 'aa', and
haystack is such that the needle can be matched in overlapping
positions, e.g. 'asdasdasdasd' or 'aaaaa'. The old implementation
counted overlapping matches, the new one doesn't. I don't think this
behavior was intentional and I don't think this change will cause any
real problems.

Change-Id: Icc905ca34bf08d63e969787a5e3c119d498bf878
2016-04-17 08:32:27 +02:00
api Remove executable bit from files 2016-04-08 14:00:52 +00:00
db_patches abuse_filter_log table only uses tinyint not int for namespace ID 2014-03-04 02:24:27 +00:00
i18n Localisation updates from https://translatewiki.net. 2016-04-15 22:15:24 +02:00
maintenance Add support for PHP CodeSniffer checks 2016-01-06 09:59:47 -08:00
modules Compress PNGs with zopflipng 2016-02-21 00:51:11 +00:00
special Remove usage of DifferenceEngine::generateDiffBody() 2016-04-02 13:10:23 +00:00
tests Optimize 'count()' function 2016-04-17 08:32:27 +02:00
Views Fixes to filter profiling 2016-04-13 23:21:32 +02:00
.gitignore Add support for PHP CodeSniffer checks 2016-01-06 09:59:47 -08:00
.gitreview Add .gitreview file 2012-03-22 13:55:41 -07:00
.jshintignore Add npm entry point 2016-02-29 19:52:23 +00:00
.jshintrc Add npm entry point 2016-02-29 19:52:23 +00:00
AbuseFilter.alias.php Localisation updates from https://translatewiki.net. 2015-06-14 21:00:08 +02:00
AbuseFilter.class.php Fixes to filter profiling 2016-04-13 23:21:32 +02:00
AbuseFilter.hooks.php Avoid crippled APIEditBeforeSave hook, use new features of EditFilterMergedContent instead 2016-04-09 01:16:28 +00:00
AbuseFilter.parser.php Optimize 'count()' function 2016-04-17 08:32:27 +02:00
AbuseFilter.php Add $wgAbuseFilterProfile to enable filter profiling 2016-04-08 16:53:45 +00:00
abusefilter.tables.pg.sql abuse_filter_log table only uses tinyint not int for namespace ID 2014-03-04 02:24:27 +00:00
abusefilter.tables.sql abuse_filter_log table only uses tinyint not int for namespace ID 2014-03-04 02:24:27 +00:00
abusefilter.tables.sqlite.sql abuse_filter_log table only uses tinyint not int for namespace ID 2014-03-04 02:24:27 +00:00
AbuseFilterTokenizer.php Remove unnecessary phpcs overrides 2016-04-12 12:36:06 +00:00
AbuseFilterVariableHolder.php Save upload related title vars in ARTICLE prefix not FILE 2016-04-02 23:13:38 +01:00
AbuseLogHitFormatter.php Add support for PHP CodeSniffer checks 2016-01-06 09:59:47 -08:00
composer.json Add support for PHP CodeSniffer checks 2016-01-06 09:59:47 -08:00
COPYING Add COPYING 2014-01-22 21:21:10 +00:00
Gruntfile.js Add npm entry point 2016-02-29 19:52:23 +00:00
hooks.txt (bug 42064) AbuseFilter + EditFilterMergedContent 2013-01-17 11:18:28 +01:00
package.json Add npm entry point 2016-02-29 19:52:23 +00:00
phpcs.xml Add support for PHP CodeSniffer checks 2016-01-06 09:59:47 -08:00