mirror of https://github.com/acidanthera/audk.git
ShellPkg/UefiShellLib: Simplify check for empty string
StrSize() uses StrLen() which counts until the terminating NULL character. For checking for an empty string it is more efficient to directly check for the NULL terminator instead of calling StrSize(). Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
This commit is contained in:
parent
e11a912aa3
commit
f34a945a80
|
@ -4012,7 +4012,7 @@ InternalShellStrHexToUint64 (
|
|||
UINT64 Result;
|
||||
BOOLEAN LeadingZero;
|
||||
|
||||
if ((String == NULL) || (StrSize (String) == sizeof (*String)) || (Value == NULL)) {
|
||||
if ((String == NULL) || (*String == CHAR_NULL) || (Value == NULL)) {
|
||||
return (EFI_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
|
@ -4116,7 +4116,7 @@ InternalShellStrDecimalToUint64 (
|
|||
{
|
||||
UINT64 Result;
|
||||
|
||||
if ((String == NULL) || (StrSize (String) == sizeof (*String)) || (Value == NULL)) {
|
||||
if ((String == NULL) || (*String == CHAR_NULL) || (Value == NULL)) {
|
||||
return (EFI_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue