Code review: Update null check to modern C++ convention

- Use modern convention (extension == nullptr) for better readability
- Add clarifying comment about lowercase requirement in extension list

Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-05 15:23:47 +00:00
parent 8da754c1b6
commit e8afe02adf

View File

@@ -15,6 +15,7 @@ namespace ImageResizerConstants
// List of supported image extensions that Image Resizer can process
// This must match the list in RuntimeRegistration.h
// Note: All extensions must be in lowercase for case-insensitive comparison
inline const std::vector<std::wstring> SupportedImageExtensions = {
L".bmp", L".dib", L".gif", L".jfif", L".jpe", L".jpeg", L".jpg",
L".jxr", L".png", L".rle", L".tif", L".tiff", L".wdp"
@@ -23,7 +24,7 @@ namespace ImageResizerConstants
// Helper function to check if a file extension is supported by Image Resizer
inline bool IsSupportedImageExtension(LPCWSTR extension)
{
if (nullptr == extension || wcslen(extension) == 0)
if (extension == nullptr || wcslen(extension) == 0)
{
return false;
}