Setup: Avoid using count() function in any kind of loop(s)
authorDerick Alangi <alangiderick@gmail.com>
Sat, 12 Jan 2019 19:39:51 +0000 (20:39 +0100)
committerThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Tue, 15 Jan 2019 11:46:51 +0000 (12:46 +0100)
commitcb2dc22b5ea2f918d579bb3d39ffa03cb3bf34e2
treef9275a31c44991bfeeb1d8ec787fd56477c9f946
parentca8678e23815a6fe8e71e897b4654cbd17a4447d
Setup: Avoid using count() function in any kind of loop(s)

Using count() function in loops makes things very slow because
of function overheads and this function gets called everytime the
loop runs meaning the bigger the value of the variable in count(),
the slower the loop as its value always gets computed as the loop
runs.

In this case, the use of foreach(...){} is possible in order to
perform the computation making it pretty fast hence improving the
performance.

Change-Id: Ie21fbf8f6acf72373d1da75023725b4592c80386
includes/Setup.php