Summary: By moving the input shared_ptr instead of copying it, we avoid doing an unnecessary ref count increment + decrement.
Reviewed By: djwatson, yfeldblum
Differential Revision:
D5298467
fbshipit-source-id:
b9f0b6999278609417bb4dc062030ca2388ba20a
}
explicit atomic_shared_ptr(SharedPtr foo) /* noexcept */
: atomic_shared_ptr() {
- store(foo);
+ store(std::move(foo));
}
atomic_shared_ptr(const atomic_shared_ptr<T>&) = delete;
store(SharedPtr(nullptr));
}
void operator=(SharedPtr desired) /* noexcept */ {
- store(desired);
+ store(std::move(desired));
}
void operator=(const atomic_shared_ptr<T>&) = delete;