-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unnecessary Variable Removal for Optimized computeIfAbsent Implementation #21175
Conversation
- Removed unnecessary object creation by eliminating the newValue variable. - Improved memory efficiency and performance of the computeIfAbsent method in the Map interface. - Ensured existing functionality remains intact and all tests pass.
Hi @dukbong, welcome to this OpenJDK project and thanks for contributing! We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user dukbong" as summary for the issue. If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing |
❗ This change is not yet ready to be integrated. |
/signed |
Thank you! Please allow for up to two weeks to process your OCA, although it is usually done within one to two business days. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated! |
I believe you have misunderstood object creation. Declaring a local variable leaves that variable in its default value, which is |
Thank you! I mistakenly referred to the local variable as object creation. I have revised my comment accordingly. |
@dukbong This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
Changes
Reason
Impact
Testing
Progress
Error
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21175/head:pull/21175
$ git checkout pull/21175
Update a local copy of the PR:
$ git checkout pull/21175
$ git pull https://git.openjdk.org/jdk.git pull/21175/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21175
View PR using the GUI difftool:
$ git pr show -t 21175
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21175.diff