1
0
Fork 0

speed up object iteration

This commit is contained in:
jsteemann 2017-01-19 12:44:09 +01:00
parent 1fdda42af9
commit 1e24b00a82
2 changed files with 6 additions and 6 deletions

View File

@ -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;
}

View File

@ -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();