mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-15 03:34:44 +00:00
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:
parent
8d0a3ea30c
commit
29162276eb
|
@ -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' ], [
|
||||
|
|
Loading…
Reference in a new issue