1
0
Fork 0

sort IN values

This commit is contained in:
jsteemann 2015-10-17 15:24:36 +02:00
parent ef2c1bc3cc
commit f075d6e4b5
1 changed files with 3 additions and 6 deletions

View File

@ -1742,6 +1742,8 @@ AstNode const* Ast::deduplicateArray (AstNode const* node) {
return node;
}
// TODO: sort values in place first and compare two adjacent members each
std::unordered_map<TRI_json_t*, AstNode const*, triagens::basics::JsonHash, triagens::basics::JsonEqual> cache(
n,
triagens::basics::JsonHash(),
@ -1757,12 +1759,7 @@ AstNode const* Ast::deduplicateArray (AstNode const* node) {
}
}
if (cache.size() == n) {
// no duplicates
return node;
}
// we got duplicates. now create a copy of the deduplicated values
// we may have got duplicates. now create a copy of the deduplicated values
auto copy = createNodeArray();
copy->members.reserve(cache.size());