Skip to content

Commit 70e7b40

Browse files
Merge pull request #5583 from kjbracey-arm/delete_null
Remove pointless null check in operator delete
2 parents 33c9726 + ff6bc08 commit 70e7b40

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

platform/mbed_retarget.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,15 +1045,11 @@ void *operator new[](std::size_t count, const std::nothrow_t& tag)
10451045

10461046
void operator delete(void *ptr)
10471047
{
1048-
if (ptr != NULL) {
1049-
free(ptr);
1050-
}
1048+
free(ptr);
10511049
}
10521050
void operator delete[](void *ptr)
10531051
{
1054-
if (ptr != NULL) {
1055-
free(ptr);
1056-
}
1052+
free(ptr);
10571053
}
10581054

10591055
/* @brief standard c library clock() function.

0 commit comments

Comments
 (0)