diff options
author | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-07-28 05:36:44 +0000 |
---|---|---|
committer | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-07-28 05:36:44 +0000 |
commit | aa2e1536cbad90542d40b8ef7e42290a8bf8aed2 (patch) | |
tree | f88190dad1f860c54d21ce44c30332b0886242f1 /MdeModulePkg | |
parent | 54bac0db0bcb7daf3b913ba937afa55db100f15e (diff) | |
download | edk2-platforms-aa2e1536cbad90542d40b8ef7e42290a8bf8aed2.tar.xz |
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
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/String.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c index 9850cba8e0..57b887d8a6 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c @@ -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);
}
|