Skip to content

GH-53730: [C++] Simplify destructor of ArrowLog - #53911

Open
taepper wants to merge 1 commit into
apache:mainfrom
taepper:gh-53730
Open

taepper wants to merge 1 commit into
apache:mainfrom
taepper:gh-53730

Conversation

@taepper

@taepper taepper commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Rationale for this change

@elfring correctly identified in #53730 that we perform an unnecessary null check before invoking delete.

Calling delete on a nullptr is completely safe.

What changes are included in this PR?

This simplifies the destructor of ArrowLog.

Additionally:

  • explicitly setting the member to nullptr in the destructor is unnecessary
  • my static analyzer also noticed that we can replace the reinterpret_cast with a safer static_cast

Are these changes tested?

Yes

Are there any user-facing changes?

No

Was AI used for this PR?

In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #53730 has been automatically assigned in GitHub to PR creator.

@taepper

taepper commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Small simplification and issue clean-up @pitrou @HuaHuaY

@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Oct 16, 2026
@elfring

elfring commented Oct 16, 2026

Copy link
Copy Markdown

Thanks for your small source code improvement.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants