Return the local variable directly, make RVO enabled (#16201)

Signed-off-by: yah01 <yang.cen@zilliz.com>
This commit is contained in:
yah01 2022-04-22 17:43:42 +08:00 committed by GitHub
parent ac6d4ef4c6
commit 3f5733b738
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -131,7 +131,7 @@ ExecPlanNodeVisitor::visit(RetrievePlanNode& node) {
segment->mask_with_delete(bitset_holder, active_count, timestamp_);
BitsetView final_view = bitset_holder;
auto seg_offsets = std::move(segment->search_ids(final_view, timestamp_));
auto seg_offsets = segment->search_ids(final_view, timestamp_);
retrieve_result.result_offsets_.assign((int64_t*)seg_offsets.data(),
(int64_t*)seg_offsets.data() + seg_offsets.size());
retrieve_result_opt_ = std::move(retrieve_result);

View File

@ -571,7 +571,7 @@ SegmentSealedImpl::search_ids(const BitsetType& bitset, Timestamp timestamp) con
dst_offset.emplace_back(SegOffset(i));
}
}
return std::move(dst_offset);
return dst_offset;
}
std::vector<SegOffset>
@ -582,7 +582,7 @@ SegmentSealedImpl::search_ids(const BitsetView& bitset, Timestamp timestamp) con
dst_offset.emplace_back(SegOffset(i));
}
}
return std::move(dst_offset);
return dst_offset;
}
std::string

View File

@ -198,7 +198,7 @@ DataGen(SchemaPtr schema, int64_t N, uint64_t seed = 42, uint64_t ts_offset = 0)
}
// std::shuffle(res.row_ids_.begin(), res.row_ids_.end(), er);
res.generate_rows(N, schema);
return std::move(res);
return res;
}
inline auto