removed creation of new strings

This commit is contained in:
Florian Steurer 2016-04-22 10:24:33 +02:00
parent 7b6b720b57
commit 6eb7f2d1bb

View File

@ -43,14 +43,14 @@ public final class ReferenceType extends UnifyType {
if(newParams.hashCode() == typeParams.hashCode() && newParams.equals(typeParams)) if(newParams.hashCode() == typeParams.hashCode() && newParams.equals(typeParams))
return this; return this;
return new ReferenceType(new String(typeName), newParams); return new ReferenceType(typeName, newParams);
} }
@Override @Override
public UnifyType setTypeParams(TypeParams newTp) { public UnifyType setTypeParams(TypeParams newTp) {
if(newTp.hashCode() == typeParams.hashCode() && newTp.equals(typeParams)) if(newTp.hashCode() == typeParams.hashCode() && newTp.equals(typeParams))
return this; // reduced the amount of objects created return this; // reduced the amount of objects created
return new ReferenceType(new String(typeName), newTp); return new ReferenceType(typeName, newTp);
} }
@Override @Override