mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-23 19:49:43 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user