diff --git a/source/binary.cpp b/source/binary.cpp index 4db32269e..2c42c920d 100644 --- a/source/binary.cpp +++ b/source/binary.cpp @@ -815,8 +815,6 @@ spv_result_t spvBinaryParse(const spv_const_context context, void* user_data, // that a spv_binary_t value is created. void spvBinaryDestroy(spv_binary binary) { if (!binary) return; - if (binary->code) { - delete[] binary->code; - } + delete[] binary->code; delete binary; } diff --git a/source/diagnostic.cpp b/source/diagnostic.cpp index a785354e2..fb6af498c 100644 --- a/source/diagnostic.cpp +++ b/source/diagnostic.cpp @@ -54,9 +54,7 @@ spv_diagnostic spvDiagnosticCreate(const spv_position position, void spvDiagnosticDestroy(spv_diagnostic diagnostic) { if (!diagnostic) return; - if (diagnostic->error) { - delete[] diagnostic->error; - } + delete[] diagnostic->error; delete diagnostic; } diff --git a/source/text.cpp b/source/text.cpp index 84b92deb2..91c04a49f 100644 --- a/source/text.cpp +++ b/source/text.cpp @@ -757,8 +757,6 @@ spv_result_t spvTextToBinary(const spv_const_context context, void spvTextDestroy(spv_text text) { if (!text) return; - if (text->str) { - delete[] text->str; - } + delete[] text->str; delete text; }