mirror of https://gitee.com/bigwinds/arangodb
speed up object iteration
This commit is contained in:
parent
1fdda42af9
commit
1e24b00a82
|
@ -246,18 +246,18 @@ class ObjectIterator {
|
|||
return ObjectPair(_slice.getNthKey(_position, true), _slice.getNthValue(_position));
|
||||
}
|
||||
|
||||
ObjectIterator begin() { return ObjectIterator(_slice, _allowRandomIteration); }
|
||||
ObjectIterator begin() { return ObjectIterator(*this); }
|
||||
|
||||
ObjectIterator begin() const { return ObjectIterator(_slice, _allowRandomIteration); }
|
||||
ObjectIterator begin() const { return ObjectIterator(*this); }
|
||||
|
||||
ObjectIterator end() {
|
||||
auto it = ObjectIterator(_slice, _allowRandomIteration);
|
||||
auto it = ObjectIterator(*this);
|
||||
it._position = it._size;
|
||||
return it;
|
||||
}
|
||||
|
||||
ObjectIterator end() const {
|
||||
auto it = ObjectIterator(_slice, _allowRandomIteration);
|
||||
auto it = ObjectIterator(*this);
|
||||
it._position = it._size;
|
||||
return it;
|
||||
}
|
||||
|
|
|
@ -3595,7 +3595,7 @@ void LogicalCollection::mergeObjectsForUpdate(
|
|||
{
|
||||
VPackObjectIterator it(newValue, true);
|
||||
while (it.valid()) {
|
||||
StringRef key(it.key());
|
||||
std::string key = it.key().copyString();
|
||||
if (!key.empty() && key[0] == '_' &&
|
||||
(key == StaticStrings::KeyString || key == StaticStrings::IdString ||
|
||||
key == StaticStrings::RevString ||
|
||||
|
@ -3609,7 +3609,7 @@ void LogicalCollection::mergeObjectsForUpdate(
|
|||
} // else do nothing
|
||||
} else {
|
||||
// regular attribute
|
||||
newValues.emplace(std::string(key.data(), key.size()), it.value());
|
||||
newValues.emplace(std::move(key), it.value());
|
||||
}
|
||||
|
||||
it.next();
|
||||
|
|
Loading…
Reference in New Issue