NetworkPkg/IScsiDxe: Remove redundant call to StrLen

The commits utilizes a local variable to store the length of a string
which will be used right after.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
This commit is contained in:
Hao Wu 2017-09-19 09:45:50 +08:00
parent 70dc3ec5a7
commit b68c793144
1 changed files with 4 additions and 2 deletions

View File

@ -766,8 +766,10 @@ IScsiConvertAttemptConfigDataToIfrNvDataByKeyword (
*(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr)) = L'/';
}
if (StrLen (IfrNvData->ISCSIMacAddr) != 0) {
*(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr) - 1) = L'\0';
StringLen = StrLen (IfrNvData->ISCSIMacAddr);
if (StringLen > 0) {
*(IfrNvData->ISCSIMacAddr + StringLen - 1) = L'\0';
}
}
}