mirror of https://github.com/acidanthera/audk.git
Optimize GetUnicodeStringTextOrSize's inner loop to call ReadUnalign16 instead of CompareMem and remove a unnecessary local variable.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5580 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
54bac0db0b
commit
aa2e1536cb
|
@ -163,15 +163,13 @@ GetUnicodeStringTextOrSize (
|
|||
)
|
||||
{
|
||||
UINTN StringSize;
|
||||
CHAR16 Zero;
|
||||
UINT8 *StringPtr;
|
||||
|
||||
ASSERT (StringSrc != NULL && BufferSize != NULL);
|
||||
|
||||
ZeroMem (&Zero, sizeof (CHAR16));
|
||||
StringSize = sizeof (CHAR16);
|
||||
StringPtr = StringSrc;
|
||||
while (CompareMem (StringPtr, &Zero, sizeof (CHAR16)) != 0) {
|
||||
while (ReadUnaligned16 ((UINT16 *) StringPtr) != 0) {
|
||||
StringSize += sizeof (CHAR16);
|
||||
StringPtr += sizeof (CHAR16);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue