8000 fix shrink method in aqlitemblock by hkernbach · Pull Request #11121 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

fix shrink method in aqlitemblock #11121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions arangod/Aql/AqlItemBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,13 @@ void AqlItemBlock::shrink(size_t nrItems) {

decreaseMemoryUsage(sizeof(AqlValue) * (_nrItems - nrItems) * _nrRegs);

// remove the shadow row indices pointing to now invalid rows.
_shadowRowIndexes.erase(_shadowRowIndexes.lower_bound(nrItems),
_shadowRowIndexes.end());

// adjust the size of the block
_nrItems = nrItems;

for (size_t i = numEntries(); i < _data.size(); ++i) {
AqlValue& a = _data[i];
if (a.requiresDestruction()) {
Expand All @@ -367,13 +374,6 @@ void AqlItemBlock::shrink(size_t nrItems) {
}
a.erase();
}

// remove the shadow row indices pointing to now invalid rows.
_shadowRowIndexes.erase(_shadowRowIndexes.lower_bound(nrItems),
_shadowRowIndexes.end());

// adjust the size of the block
_nrItems = nrItems;
}

void AqlItemBlock::rescale(size_t nrItems, RegisterId nrRegs) {
Expand Down
0