Optimize the code to not call StrToBuf when DataLength is 0.

Signed-off-by: Ruiyu Ni <ruyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15143 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Ruiyu Ni 2014-01-21 07:34:41 +00:00 committed by niruiyu
parent 2d441ca9cd
commit 66a110d7c9
1 changed files with 3 additions and 1 deletions

View File

@ -567,7 +567,9 @@ DevPathFromTextGenericPath (
(UINT16) (sizeof (EFI_DEVICE_PATH_PROTOCOL) + DataLength)
);
StrToBuf ((UINT8 *) (Node + 1), DataLength, DataStr);
if (DataLength != 0) {
StrToBuf ((UINT8 *) (Node + 1), DataLength, DataStr);
}
return Node;
}