Remove unnecessary null pointer checks

Fixes #110
This commit is contained in:
Eric Engestrom 2016-02-18 23:41:16 +00:00
parent bd354d442a
commit eb6ae976c6
3 changed files with 3 additions and 9 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}