ApiTemplateData: Remove needless count() call

These variables always hold arrays, and to assert an array being
non-empty, boolean evaluation is reliable and suffices.

Change-Id: I5173f9d38ff52807a8025897115823d093052ecf
This commit is contained in:
Timo Tijhof 2018-10-14 03:51:38 +01:00
parent 8d0a3ea30c
commit 29162276eb

View file

@ -71,7 +71,7 @@ class ApiTemplateData extends ApiBase {
$includeMissingTitles = $doNotIgnoreMissingTitles;
}
if ( !count( $titles ) && ( !$includeMissingTitles || !count( $missingTitles ) ) ) {
if ( !$titles && ( !$includeMissingTitles || !$missingTitles ) ) {
$result->addValue( null, 'pages', (object)[] );
$this->setContinuationManager( null );
$continuationManager->setContinuationIntoResult( $this->getResult() );
@ -90,7 +90,7 @@ class ApiTemplateData extends ApiBase {
}
}
if ( count( $titles ) ) {
if ( $titles ) {
$db = $this->getDB();
$res = $db->select( 'page_props',
[ 'pp_page', 'pp_value' ], [