Files
Aaron Pop 33219cef73 MdeModulePkg: Fix useless tests.
https://github.com/github/codeql/blob/codeql-cli-2.7.3/java/ql/src/Language%20Abuse/UselessNullCheck.qhelp

These are all recognized as useless checks.

if (*TempString != L'\0' && *TempString == L'\\') {
if ((*FilePath != L'\0') && (*FilePath == L'\\')) {
while (*Str != '\0' && *Str == ' ') {
while (*Str != '\0' && *Str == '0') {
if ((*Str != '\0') && ((*Str == 'x') || (*Str == 'X'))) {
while (*Str != '\0' && *Str == ' ') {

For all of these cases, they are checking if the variable
is not nil before they check if the character matches an exact character.

If the variable matches the exact character, but that virtue,
it will not be nil.

Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
2025-11-23 00:23:22 +00:00
..
2025-11-23 00:23:22 +00:00