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));
|
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() {
|
ObjectIterator end() {
|
||||||
auto it = ObjectIterator(_slice, _allowRandomIteration);
|
auto it = ObjectIterator(*this);
|
||||||
it._position = it._size;
|
it._position = it._size;
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectIterator end() const {
|
ObjectIterator end() const {
|
||||||
auto it = ObjectIterator(_slice, _allowRandomIteration);
|
auto it = ObjectIterator(*this);
|
||||||
it._position = it._size;
|
it._position = it._size;
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3595,7 +3595,7 @@ void LogicalCollection::mergeObjectsForUpdate(
|
||||||
{
|
{
|
||||||
VPackObjectIterator it(newValue, true);
|
VPackObjectIterator it(newValue, true);
|
||||||
while (it.valid()) {
|
while (it.valid()) {
|
||||||
StringRef key(it.key());
|
std::string key = it.key().copyString();
|
||||||
if (!key.empty() && key[0] == '_' &&
|
if (!key.empty() && key[0] == '_' &&
|
||||||
(key == StaticStrings::KeyString || key == StaticStrings::IdString ||
|
(key == StaticStrings::KeyString || key == StaticStrings::IdString ||
|
||||||
key == StaticStrings::RevString ||
|
key == StaticStrings::RevString ||
|
||||||
|
@ -3609,7 +3609,7 @@ void LogicalCollection::mergeObjectsForUpdate(
|
||||||
} // else do nothing
|
} // else do nothing
|
||||||
} else {
|
} else {
|
||||||
// regular attribute
|
// regular attribute
|
||||||
newValues.emplace(std::string(key.data(), key.size()), it.value());
|
newValues.emplace(std::move(key), it.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
it.next();
|
it.next();
|
||||||
|
|
Loading…
Reference in New Issue