media: Swap second if for elseif in FormatMetdata::sanitizeKeyForAPI()

Also swap == for ===

Noted in T268133 as a minor optimisation

Change-Id: I7c2198b68cd91dc7a642d0c1f6ce3bf39aeccc41
This commit is contained in:
Reedy 2020-11-18 12:58:55 +00:00
parent 730e2e5cd1
commit 7acc57cff9

View file

@ -2007,12 +2007,10 @@ class FormatMetadata extends ContextSource {
// drop characters which are invalid at the first position
$key = preg_replace( '/^[\d\-.]+/', '', $key );
if ( $key == '' ) {
if ( $key === '' ) {
$key = '_';
}
// special case for an internal keyword
if ( $key == '_element' ) {
} elseif ( $key === '_element' ) {
$key = 'element';
}