Skip to content

Remove redundant null check before delete in wrapper_class#19

Open
tbobo wants to merge 1 commit into
cmu-db:mainfrom
tbobo:main
Open

Remove redundant null check before delete in wrapper_class#19
tbobo wants to merge 1 commit into
cmu-db:mainfrom
tbobo:main

Conversation

@tbobo

@tbobo tbobo commented Feb 15, 2024

Copy link
Copy Markdown

As it turns out, the C++ standard guarantees that a delete against a null pointer is a no-op. From https://en.cppreference.com/w/cpp/memory/new/operator_delete:

In all cases, if ptr is a null pointer, the standard library deallocation functions do nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant