Skip to content
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

Allow field getters to return a std::shared_ptr<const response::Value> #181

Merged
merged 3 commits into from
Dec 14, 2021

Conversation

wravery
Copy link
Contributor

@wravery wravery commented Dec 14, 2021

In cases where copying elements between service::ResolverResult documents and converting to response::Value adds a lot of overhead, field getters can now hold on to a pre-converted std::shared_ptr<const response::Value> and return that. The ModifiedResult and FieldResult will prefer that over a value of T or std::future<T>, and response::Value can now perform copy-on-write from a std::shared_ptr<const response::Value>, so it doesn't need to repeat any conversion or copying to keep returning the same shared_ptr.

@wravery wravery merged commit 5eeba63 into microsoft:next Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant