[Image] remove more unnecessary Boolean comparisons

This commit is contained in:
Uwe
2022-06-19 18:32:06 +02:00
parent 967c7fff65
commit dbea942dda

View File

@@ -47,7 +47,7 @@ ImageBase::~ImageBase()
ImageBase::ImageBase(const ImageBase &rhs)
{
// Do the copy
if (rhs._owner == true)
if (rhs._owner)
{
// rhs is the owner - do a deep copy
_pPixelData = nullptr;
@@ -76,7 +76,7 @@ ImageBase & ImageBase::operator=(const ImageBase &rhs)
clear();
// Do the copy
if (rhs._owner == true)
if (rhs._owner)
{
// rhs is the owner - do a deep copy
_owner = false; // avoids a superfluous delete
@@ -102,7 +102,7 @@ ImageBase & ImageBase::operator=(const ImageBase &rhs)
void ImageBase::clear()
{
// If object is the owner of the data then delete the allocated memory
if (_owner == true)
if (_owner)
{
delete [] _pPixelData;
_pPixelData = nullptr;
@@ -283,7 +283,7 @@ int ImageBase::pointTo(void* pSrcPixelData, unsigned long width, unsigned long h
_pPixelData = (unsigned char *)pSrcPixelData;
// Flag ownership
if (takeOwnership == true)
if (takeOwnership)
_owner = true;
else
_owner = false;