Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/249879
Change subject: Revert "Avoid counting arrays if not needed"
......................................................................
Revert "Avoid counting arrays if not needed"
This reverts commit c00cf4a204954acef2f50712c38d33f3741df5f7.
Change-Id: I25af4eaaf9bd25c9b0aba1bda0e72455ff878b9b
---
M Cite_body.php
1 file changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite
refs/changes/79/249879/1
diff --git a/Cite_body.php b/Cite_body.php
index 98331d1..8c5e808 100644
--- a/Cite_body.php
+++ b/Cite_body.php
@@ -525,7 +525,7 @@
case 'new':
# Rollback the addition of new elements to the stack.
unset( $this->mRefs[$group][$key] );
- if ( $this->mRefs[$group] === array() ) {
+ if ( count( $this->mRefs[$group] ) === 0 ) {
unset( $this->mRefs[$group] );
unset( $this->mGroupCnt[$group] );
}
@@ -592,7 +592,7 @@
# Mostly a side effect of using #tag to call references
$count = substr_count( $str, Parser::MARKER_PREFIX .
"-ref-" );
for ( $i = 1; $i <= $count; $i++ ) {
- if ( !$this->mRefCallStack ) {
+ if ( count( $this->mRefCallStack ) < 1 ) {
break;
}
@@ -623,10 +623,10 @@
$this->mRefCallStack = array();
}
- if ( $argv && $wgAllowCiteGroups ) {
+ if ( count( $argv ) && $wgAllowCiteGroups ) {
return $this->error(
'cite_error_references_invalid_parameters_group' );
}
- if ( $argv ) {
+ if ( count( $argv ) ) {
return $this->error(
'cite_error_references_invalid_parameters' );
}
@@ -636,7 +636,7 @@
}
# Append errors generated while processing <references>
- if ( $this->mReferencesErrors ) {
+ if ( count( $this->mReferencesErrors ) > 0 ) {
$s .= "\n" . implode( "<br />\n",
$this->mReferencesErrors );
$this->mReferencesErrors = array();
}
@@ -651,7 +651,7 @@
* @return string XHTML ready for output
*/
function referencesFormat( $group ) {
- if ( !$this->mRefs || !$this->mRefs[$group] ) {
+ if ( ( count( $this->mRefs ) === 0 ) || ( empty(
$this->mRefs[$group] ) ) ) {
return '';
}
@@ -1083,7 +1083,7 @@
}
foreach ( $this->mRefs as $group => $refs ) {
- if ( !$refs ) {
+ if ( count( $refs ) === 0 ) {
continue;
}
if ( $group === self::DEFAULT_GROUP ) {
--
To view, visit https://gerrit.wikimedia.org/r/249879
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I25af4eaaf9bd25c9b0aba1bda0e72455ff878b9b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cite
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits