mirror of https://github.com/acidanthera/audk.git
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:
parent
2d441ca9cd
commit
66a110d7c9
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue