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:
Daimona Eaytoy 2019-10-02 13:35:38 +02:00 committed by Krinkle
parent 0a95a6572c
commit c7fa503e9b

View file

@ -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