Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Fix Issue 20711 - object.update requires the "update" callback to was… #3012

Merged
merged 1 commit into from
Mar 31, 2020

Conversation

CyberShadow
Copy link
Member

…tefully return a copy of the updated value

Also update the examples to illustrate the new, more efficient option.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @CyberShadow!

Bugzilla references

Auto-close Bugzilla Severity Description
20711 enhancement object.update requires the "update" callback to wastefully return a copy of the updated value

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + druntime#3012"

@dlang-bot dlang-bot added the Enhancement New functionality label Mar 31, 2020
Copy link
Member

@Geod24 Geod24 left a comment

Choose a reason for hiding this comment

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

Great!

@GilesBathgate
Copy link
Contributor

If I understand the fix is to ensure that if the callback function returns void (i.e its a subroutine in other languages) then no copy of the result needs to be made.

In which case the change looks good to me.

@CyberShadow
Copy link
Member Author

Had to rebase as it seems the Buildkite Phobos test does not merge the branch into master before testing.

@dlang-bot dlang-bot merged commit ffdc616 into dlang:master Mar 31, 2020
omerfirmak added a commit to omerfirmak/agora that referenced this pull request Jan 6, 2021
dlang/druntime#3012 seems to be missing in the CI env.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants