|
Author:
{'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}
Message: SERVER-80480 Avoid implicit copy of PolyValue from reference_type
Previously we had an implicit constructor, 'PolyValue(const Reference&)'.
This resulted in some hard to spot deep copies, and counterintuitive
behavior where adding '.ref()' would force copying where omitting
'.ref()' would not have needed to copy.
This commit reverses that default: the expensive deep-copying
constructor is explicit, and the cheap 'Reference(const PolyValue&)'
constructor is implicit. Passing a value where only a view is required
is cheap and implicit; creating a new value given only a view is
expensive, and explicit.
Branch: master
https://github.com/mongodb/mongo/commit/2e2149c8bcc6cf4a4892ac5be6c150949808ae18
|