1
0
Fork 0

a bit less copying

This commit is contained in:
Jan Steemann 2015-07-30 12:20:22 +02:00
parent 57fa0e45a9
commit 24b44e474f
2 changed files with 13 additions and 11 deletions

View File

@ -654,18 +654,17 @@ RangeInfoMapVec* triagens::aql::orCombineRangeInfoMapVecs (RangeInfoMapVec* lhs,
}
////////////////////////////////////////////////////////////////////////////////
/// @brief andCombineRangeInfoMaps: insert every RangeInfo in the <rhs> in the
/// <lhs> and delete the <rhs>
/// @brief andCombineRangeInfoMaps: insert every RangeInfo in the right argument
/// in a new copy of the left argument
////////////////////////////////////////////////////////////////////////////////
RangeInfoMap* triagens::aql::andCombineRangeInfoMaps (RangeInfoMap* lhs,
RangeInfoMap* rhs) {
RangeInfoMap const* rhs) {
for (auto const& x : rhs->_ranges) {
for (auto const& y : x.second) {
lhs->insert(y.second.clone());
}
}
delete rhs;
return lhs;
}
@ -698,7 +697,7 @@ RangeInfoMapVec* triagens::aql::andCombineRangeInfoMapVecs (RangeInfoMapVec* lhs
std::unique_ptr<RangeInfoMapVec> rimv(new RangeInfoMapVec()); // must be a new one
for (size_t i = 0; i < lhs->size(); i++) {
for (size_t j = 0; j < rhs->size(); j++) {
rimv->emplace_back(std::move(andCombineRangeInfoMaps((*lhs)[i]->clone(), (*rhs)[j]->clone())));
rimv->emplace_back(andCombineRangeInfoMaps((*lhs)[i]->clone(), (*rhs)[j]));
}
}

View File

@ -863,8 +863,7 @@ namespace triagens {
/// can be private
////////////////////////////////////////////////////////////////////////////////
std::unordered_map<std::string, std::unordered_map<std::string,
RangeInfo>> _ranges;
std::unordered_map<std::string, std::unordered_map<std::string, RangeInfo>> _ranges;
};
@ -1029,7 +1028,8 @@ namespace triagens {
/// in a new copy of the left argument
////////////////////////////////////////////////////////////////////////////////
RangeInfoMap* andCombineRangeInfoMaps (RangeInfoMap*, RangeInfoMap*);
RangeInfoMap* andCombineRangeInfoMaps (RangeInfoMap*,
RangeInfoMap const*);
////////////////////////////////////////////////////////////////////////////////
/// @brief orCombineRangeInfoMapVecs: return a new RangeInfoMapVec appending
@ -1039,7 +1039,8 @@ namespace triagens {
/// The return RIMV is new unless one of the arguments is empty.
////////////////////////////////////////////////////////////////////////////////
RangeInfoMapVec* orCombineRangeInfoMapVecs (RangeInfoMapVec*, RangeInfoMapVec*);
RangeInfoMapVec* orCombineRangeInfoMapVecs (RangeInfoMapVec*,
RangeInfoMapVec*);
////////////////////////////////////////////////////////////////////////////////
/// @brief andCombineRangeInfoMapVecs: return a new RangeInfoMapVec by
@ -1049,14 +1050,16 @@ namespace triagens {
/// The return RIMV is new unless one of the arguments is empty.
////////////////////////////////////////////////////////////////////////////////
RangeInfoMapVec* andCombineRangeInfoMapVecs (RangeInfoMapVec*, RangeInfoMapVec*);
RangeInfoMapVec* andCombineRangeInfoMapVecs (RangeInfoMapVec*,
RangeInfoMapVec*);
////////////////////////////////////////////////////////////////////////////////
/// @brief andCombineRangeInfoMapVecs: same as before, but will return the
/// mapvec even if one side is a nullptr
////////////////////////////////////////////////////////////////////////////////
RangeInfoMapVec* andCombineRangeInfoMapVecsIgnoreEmpty (RangeInfoMapVec*, RangeInfoMapVec*);
RangeInfoMapVec* andCombineRangeInfoMapVecsIgnoreEmpty (RangeInfoMapVec*,
RangeInfoMapVec*);
////////////////////////////////////////////////////////////////////////////////
/// @brief IndexOrCondition, type for vector of vector of RangeInfo. The meaning