mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-27 23:40:19 +00:00
Remove AFPData::dup
The method, which simply duplicates an AFPData instance, is only used when casting types, to return a different instance when the object already has the desired type. However, nothing is assuming that, so we can just return the original instance and save some time. Bug: T234427 Change-Id: Id8067b418a00260ceead35f234e55268390699ab
This commit is contained in:
parent
0a95a6572c
commit
c7fa503e9b
|
@ -98,13 +98,6 @@ class AFPData {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AFPData
|
||||
*/
|
||||
private function dup() {
|
||||
return new AFPData( $this->type, $this->data );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AFPData $orig
|
||||
* @param string $target
|
||||
|
@ -112,7 +105,7 @@ class AFPData {
|
|||
*/
|
||||
public static function castTypes( AFPData $orig, $target ) {
|
||||
if ( $orig->type === $target ) {
|
||||
return $orig->dup();
|
||||
return $orig;
|
||||
}
|
||||
if ( $orig->type === self::DUNDEFINED ) {
|
||||
// This case should be handled at a higher level, to avoid implicitly relying on what
|
||||
|
|
Loading…
Reference in a new issue