avoid memcpy call when only copying one (PRUnichar) char. bug 109562. r=jag sr=brendan

This commit is contained in:
jband%netscape.com 2002-02-14 06:22:53 +00:00
parent 82521cf5de
commit 222f0cec01
2 changed files with 8 additions and 2 deletions

View File

@ -436,7 +436,10 @@ void CopyChars2To2(char* aDest,PRInt32 anDestOffset,const char* aSource,PRUint32
PRUnichar* theSource=(PRUnichar*)aSource;
PRUnichar* from= theSource+anOffset;
memcpy((void*)to,(void*)from,aCount*sizeof(PRUnichar));
if(aCount == 1)
*to = *from;
else
memcpy((void*)to,(void*)from,aCount*sizeof(PRUnichar));
}

View File

@ -436,7 +436,10 @@ void CopyChars2To2(char* aDest,PRInt32 anDestOffset,const char* aSource,PRUint32
PRUnichar* theSource=(PRUnichar*)aSource;
PRUnichar* from= theSource+anOffset;
memcpy((void*)to,(void*)from,aCount*sizeof(PRUnichar));
if(aCount == 1)
*to = *from;
else
memcpy((void*)to,(void*)from,aCount*sizeof(PRUnichar));
}