refactor: remove redundant comparing array address to zero

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-09-29 15:04:59 +00:00
committed by Compute-Runtime-Automation
parent 5402c9a13f
commit 4a80380aaf
2 changed files with 8 additions and 8 deletions

View File

@@ -498,7 +498,7 @@ struct RequestProperty {
componentId = other.componentId;
paramInfo = other.paramInfo;
dataSize = other.dataSize;
if (other.dataSize > 0 && other.dataSize < MaxPropertyBufferSize && other.dataBuffer) {
if (other.dataSize > 0 && other.dataSize < MaxPropertyBufferSize) {
memcpy_s(dataBuffer, other.dataSize, other.dataBuffer, other.dataSize);
}
}
@@ -523,7 +523,7 @@ struct RequestProperty {
componentId = other.componentId;
paramInfo = other.paramInfo;
dataSize = other.dataSize;
if (other.dataSize > 0 && other.dataSize < MaxPropertyBufferSize && other.dataBuffer) {
if (other.dataSize > 0 && other.dataSize < MaxPropertyBufferSize) {
memcpy_s(dataBuffer, other.dataSize, other.dataBuffer, other.dataSize);
}
return *this;
@@ -543,7 +543,7 @@ struct ResponseProperty {
returnCode = other.returnCode;
componentId = other.componentId;
dataSize = other.dataSize;
if (other.dataSize > 0 && other.dataSize < MaxPropertyBufferSize && other.dataBuffer) {
if (other.dataSize > 0 && other.dataSize < MaxPropertyBufferSize) {
memcpy_s(dataBuffer, other.dataSize, other.dataBuffer, other.dataSize);
}
}
@@ -565,7 +565,7 @@ struct ResponseProperty {
this->returnCode = other.returnCode;
this->componentId = other.componentId;
this->dataSize = other.dataSize;
if (other.dataSize > 0 && other.dataSize < MaxPropertyBufferSize && other.dataBuffer) {
if (other.dataSize > 0 && other.dataSize < MaxPropertyBufferSize) {
memcpy_s(this->dataBuffer, other.dataSize, other.dataBuffer, other.dataSize);
}
return *this;