[GH-ISSUE #2096] Remove unnecessary null pointer checks #722

Closed
opened 2026-02-27 21:07:47 +03:00 by kerem · 2 comments
Owner

Originally created by @elfring on GitHub (Jan 8, 2025).
Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/2096

Checklist

  • I have searched for a similar issue in this repository and did not find one.

Description

An extra null pointer check is not needed in functions like the following.

Reason

Improved software implementation

Examples

No response

Originally created by @elfring on GitHub (Jan 8, 2025). Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/2096 ### Checklist - [X] I have searched for a similar issue in this repository and did not find one. ### Description An extra null pointer check is not needed in functions like the following. - [internal_operator_delete](https://github.com/shadps4-emu/shadPS4/blob/0eee36cbc7b6e6e7b605f532925845ec30630c7c/src/core/libraries/libc_internal/libc_internal.cpp#L210-L214 "internal_operator_delete function") - [NativeThread::Exit](https://github.com/shadps4-emu/shadPS4/blob/0eee36cbc7b6e6e7b605f532925845ec30630c7c/src/core/thread.cpp#L123-L126 "NativeThread::Exit function") - [Shutdown](https://github.com/shadps4-emu/shadPS4/blob/0eee36cbc7b6e6e7b605f532925845ec30630c7c/src/imgui/renderer/imgui_impl_sdl3.cpp#L591-L593 "Shutdown function") ### Reason Improved software implementation ### Examples _No response_
kerem closed this issue 2026-02-27 21:07:47 +03:00
Author
Owner

@Hermiten commented on GitHub (Jan 23, 2025):

Any devs for this ?

<!-- gh-comment-id:2609911246 --> @Hermiten commented on GitHub (Jan 23, 2025): Any devs for this ?
Author
Owner

@elfring commented on GitHub (Jan 23, 2025):

💭 Would you become interested to use a development tool like “clang-tidy” for corresponding source code adjustments?

<!-- gh-comment-id:2609922730 --> @elfring commented on GitHub (Jan 23, 2025): :thought_balloon: Would you become interested to [use a development tool like “clang-tidy” for corresponding source code adjustments](https://clang.llvm.org/extra/clang-tidy/checks/readability/delete-null-pointer.html "Deletion of unnecessary null pointer checks")?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#722
No description provided.