Remove not needed and collapse overly complicated code

Change-Id: Iee4241245280b23ab2aaf452363e7db3e21f5554
This commit is contained in:
Thiemo Kreuz 2019-11-04 16:04:42 +01:00
parent 4ae083fe72
commit a4b9302d88

View file

@ -243,11 +243,7 @@ class Cite {
}
# Split these into groups.
if ( $group === null ) {
if ( $this->mInReferences ) {
$group = $this->mReferencesGroup;
} else {
$group = self::DEFAULT_GROUP;
}
$group = $this->mInReferences ? $this->mReferencesGroup : self::DEFAULT_GROUP;
}
if ( $this->mInReferences ) {
@ -608,13 +604,10 @@ class Cite {
}
// Sanity checks that specified element exists.
if ( $key === null ) {
return;
}
if ( !isset( $this->mRefs[$group][$key] ) ) {
return;
}
if ( $this->mRefs[$group][$key]['key'] != $index ) {
if ( $key === null ||
!isset( $this->mRefs[$group][$key] ) ||
$this->mRefs[$group][$key]['key'] !== $index
) {
return;
}
@ -764,7 +757,7 @@ class Cite {
* @return string HTML ready for output
*/
private function referencesFormat( $group, $responsive ) {
if ( !$this->mRefs || !isset( $this->mRefs[$group] ) ) {
if ( !isset( $this->mRefs[$group] ) ) {
return '';
}