-
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
enhancementNew feature or requestNew feature or request
Description
void do_move_assign(svector&& other) {
// if (!other.is_direct()) {
// // take other's memory, even when empty
// set_indirect(other.indirect());
// } else {
// auto* other_ptr = other.data<direction::direct>();
// auto s = other.size<direction::direct>();
// auto* other_end = other_ptr + s;
//
// std::uninitialized_move(other_ptr, other_end, data<direction::direct>());
// std::destroy(other_ptr, other_end);
// set_size(s);
// }
m_data = std::move(other.m_data);
other.set_direct_and_size(0);
}I notice that the original do move assign function is not efficient (using Vtune), and just move the m_data could significantly improve the performance.
Since the precondition is all uninitialized, I think move m_data directly is just equal to the previous code in results.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request