mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-31 02:48:48 +00:00
avoid memcpy call when only copying one (PRUnichar) char. bug 109562. r=jag sr=brendan
This commit is contained in:
parent
82521cf5de
commit
222f0cec01
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user