jenkins-bot has submitted this change and it was merged.
Change subject: collation: Remove suppressWarnings() for getSortKey()
......................................................................
collation: Remove suppressWarnings() for getSortKey()
Small optimization to IcuCollation::fetchFirstLetterData().
This used to suppress / restore warnings once per every letter of
every alphabet. The workaround for string casting and error
suppression is no longer needed as of PHP 5.3, in which the
bug was fixed.
Change-Id: Idd41a509858c0887df4f632b480b387bd74027b2
---
M includes/collation/IcuCollation.php
1 file changed, 2 insertions(+), 11 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
Ori.livneh: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/includes/collation/IcuCollation.php
b/includes/collation/IcuCollation.php
index a374b13..f6a9dc7 100644
--- a/includes/collation/IcuCollation.php
+++ b/includes/collation/IcuCollation.php
@@ -188,20 +188,11 @@
}
public function getSortKey( $string ) {
- // intl extension produces non null-terminated
- // strings. Appending '' fixes it so that it doesn't generate
- // a warning on each access in debug php.
- MediaWiki\suppressWarnings();
- $key = $this->mainCollator->getSortKey( $string ) . '';
- MediaWiki\restoreWarnings();
- return $key;
+ return $this->mainCollator->getSortKey( $string );
}
public function getPrimarySortKey( $string ) {
- MediaWiki\suppressWarnings();
- $key = $this->primaryCollator->getSortKey( $string ) . '';
- MediaWiki\restoreWarnings();
- return $key;
+ return $this->primaryCollator->getSortKey( $string );
}
public function getFirstLetter( $string ) {
--
To view, visit https://gerrit.wikimedia.org/r/290367
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Idd41a509858c0887df4f632b480b387bd74027b2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: PleaseStand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits