Use _d_arraycatT to append an element to an array instead of reallocating the array

This commit is contained in:
Alexey Prokhin
2011-09-10 13:23:47 +04:00
parent 0caba6672d
commit f3c901af9d
3 changed files with 14 additions and 3 deletions

View File

@@ -2428,8 +2428,11 @@ DValue* CatExp::toElem(IRState* p)
Logger::print("CatExp::toElem: %s @ %s\n", toChars(), type->toChars());
LOG_SCOPE;
bool arrNarr = e1->type->toBasetype() == e2->type->toBasetype();
#if DMDV2
return DtoCatArrays(type, e1, e2);
#else
bool arrNarr = e1->type->toBasetype() == e2->type->toBasetype();
// array ~ array
if (arrNarr)
{
@@ -2441,6 +2444,7 @@ DValue* CatExp::toElem(IRState* p)
{
return DtoCatArrayElement(type, e1, e2);
}
#endif
}
//////////////////////////////////////////////////////////////////////////////////////////