diff options
author | Daimona Eaytoy <daimona.wiki@gmail.com> | 2023-09-08 23:28:11 +0200 |
---|---|---|
committer | Daimona Eaytoy <daimona.wiki@gmail.com> | 2023-09-08 23:28:11 +0200 |
commit | 154f04299c179ef5dcc2979c92fe77d27d6eebd4 (patch) | |
tree | d943960a143eca5692874518d53f9dcb59f48dfa /includes/media/ThumbnailImage.php | |
parent | 3f35734ac073465bbe99842d1e02799e5dc1f589 (diff) | |
download | mediawikicore-154f04299c179ef5dcc2979c92fe77d27d6eebd4.tar.gz mediawikicore-154f04299c179ef5dcc2979c92fe77d27d6eebd4.zip |
Remove redundant empty() constructs (2)
empty() only makes sense when the expression it checks is possibly
undefined, otherwise it's equivalent to a truthiness check with the
additional downside of suppressing errors when it's not wanted.
Replace it with simple truthiness checks, using strict comparison when
that seems to help with polymorphic variables.
These were caught by a bespoke phan plugin.
Change-Id: I70b629dbf9e47cf3ba48ff439b18f19e839677f4
Diffstat (limited to 'includes/media/ThumbnailImage.php')
-rw-r--r-- | includes/media/ThumbnailImage.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/media/ThumbnailImage.php b/includes/media/ThumbnailImage.php index d1f81fc06c6d..c814c3434639 100644 --- a/includes/media/ThumbnailImage.php +++ b/includes/media/ThumbnailImage.php @@ -215,7 +215,7 @@ class ThumbnailImage extends MediaTransformOutput { // Additional densities for responsive images, if specified. // If any of these urls is the same as src url, it'll be excluded. $responsiveUrls = array_diff( $this->responsiveUrls, [ $this->url ] ); - if ( !empty( $responsiveUrls ) ) { + if ( $responsiveUrls ) { $attribs['srcset'] = Html::srcSet( $responsiveUrls ); } |