Skip to content

Remove unused isNewNativeImage parameter from NativeImage::Open#123775

Merged
elinor-fung merged 2 commits intomainfrom
copilot/remove-unused-isnewnativeimage-parameter
Mar 31, 2026
Merged

Remove unused isNewNativeImage parameter from NativeImage::Open#123775
elinor-fung merged 2 commits intomainfrom
copilot/remove-unused-isnewnativeimage-parameter

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 29, 2026

Description

The isNewNativeImage out parameter in NativeImage::Open was being populated but never used by the sole caller in AssemblyBinder::LoadNativeImage.

Changes

  • Removed isNewNativeImage parameter from method signature in nativeimage.h and nativeimage.cpp
  • Removed three assignments to *isNewNativeImage in the implementation
  • Removed unused local variable at call site in assemblybinder.cpp

Files Changed

  • src/coreclr/vm/nativeimage.h
  • src/coreclr/vm/nativeimage.cpp
  • src/coreclr/vm/assemblybinder.cpp

cc @dotnet/appmodel @AaronRobinsonMSFT

Original prompt

The isNewNativeImage parameter to NativeImage::Open does not appear to be used. Remove it.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove unused isNewNativeImage parameter from NativeImage::Open Remove unused isNewNativeImage parameter from NativeImage::Open Jan 29, 2026
Copilot AI requested a review from elinor-fung January 29, 2026 22:14
@elinor-fung elinor-fung added the area-AssemblyLoader-coreclr only use for closed issues label Jan 30, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @elinor-fung
See info in area-owners.md if you want to be subscribed.

@elinor-fung elinor-fung marked this pull request as ready for review January 30, 2026 17:23
Copilot AI review requested due to automatic review settings January 30, 2026 17:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes an unused isNewNativeImage out parameter from NativeImage::Open and cleans up its only call site, simplifying the native image loading path.

Changes:

  • Updated NativeImage::Open declaration in nativeimage.h to drop the /* out */ bool *isNewNativeImage parameter.
  • Updated the implementation in nativeimage.cpp by removing all assignments to *isNewNativeImage and aligning the signature with the header.
  • Simplified AssemblyBinder::LoadNativeImage in assemblybinder.cpp by removing the unused isNewNativeImage local and updating the call to NativeImage::Open.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/coreclr/vm/nativeimage.h Adjusts the NativeImage::Open API to remove the unused out parameter from the declaration.
src/coreclr/vm/nativeimage.cpp Keeps the implementation in sync with the new signature and removes dead assignments to isNewNativeImage.
src/coreclr/vm/assemblybinder.cpp Cleans up the only call site by removing the unused local and calling the simplified NativeImage::Open overload.

@elinor-fung
Copy link
Copy Markdown
Member

/ba-g unrelated timeouts

@elinor-fung elinor-fung merged commit 7923747 into main Mar 31, 2026
107 of 113 checks passed
@github-project-automation github-project-automation Bot moved this to Done in AppModel Mar 31, 2026
@elinor-fung elinor-fung deleted the copilot/remove-unused-isnewnativeimage-parameter branch March 31, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-AssemblyLoader-coreclr only use for closed issues

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants