1
0
Fork 0

whitespace

This commit is contained in:
Jan Steemann 2014-11-08 21:26:54 +01:00
parent e120bdec8c
commit 738636db2d
1 changed files with 20 additions and 20 deletions

View File

@ -409,7 +409,7 @@ size_t ExecutionBlock::skipSome (size_t atLeast, size_t atMost) {
bool ExecutionBlock::skip (size_t number) { bool ExecutionBlock::skip (size_t number) {
size_t skipped = skipSome(number, number); size_t skipped = skipSome(number, number);
size_t nr = skipped; size_t nr = skipped;
while ( nr != 0 && skipped < number ){ while (nr != 0 && skipped < number) {
nr = skipSome(number - skipped, number - skipped); nr = skipSome(number - skipped, number - skipped);
skipped += nr; skipped += nr;
} }
@ -485,7 +485,7 @@ int ExecutionBlock::getOrSkipSome (size_t atLeast,
if (cur->size() - _pos > atMost - skipped) { if (cur->size() - _pos > atMost - skipped) {
// The current block is too large for atMost: // The current block is too large for atMost:
if (! skipping){ if (! skipping) {
unique_ptr<AqlItemBlock> more(cur->slice(_pos, _pos + (atMost - skipped))); unique_ptr<AqlItemBlock> more(cur->slice(_pos, _pos + (atMost - skipped)));
collector.push_back(more.get()); collector.push_back(more.get());
more.release(); // do not delete it! more.release(); // do not delete it!
@ -496,7 +496,7 @@ int ExecutionBlock::getOrSkipSome (size_t atLeast,
else if (_pos > 0) { else if (_pos > 0) {
// The current block fits into our result, but it is already // The current block fits into our result, but it is already
// half-eaten: // half-eaten:
if(! skipping){ if (! skipping) {
unique_ptr<AqlItemBlock> more(cur->slice(_pos, cur->size())); unique_ptr<AqlItemBlock> more(cur->slice(_pos, cur->size()));
collector.push_back(more.get()); collector.push_back(more.get());
more.release(); more.release();
@ -590,7 +590,7 @@ int SingletonBlock::getOrSkipSome (size_t, // atLeast,
return TRI_ERROR_NO_ERROR; return TRI_ERROR_NO_ERROR;
} }
if(! skipping){ if (! skipping) {
result = new AqlItemBlock(1, getPlanNode()->getRegisterPlan()->nrRegs[getPlanNode()->getDepth()]); result = new AqlItemBlock(1, getPlanNode()->getRegisterPlan()->nrRegs[getPlanNode()->getDepth()]);
try { try {
if (_inputRegisterValues != nullptr) { if (_inputRegisterValues != nullptr) {
@ -1206,7 +1206,7 @@ size_t IndexRangeBlock::skipSome (size_t atLeast,
size_t skipped = 0; size_t skipped = 0;
while (skipped < atLeast ){ while (skipped < atLeast) {
if (_buffer.empty()) { if (_buffer.empty()) {
if (! ExecutionBlock::getBlock(DefaultBatchSize, DefaultBatchSize)) { if (! ExecutionBlock::getBlock(DefaultBatchSize, DefaultBatchSize)) {
_done = true; _done = true;
@ -1590,7 +1590,7 @@ EnumerateListBlock::EnumerateListBlock (ExecutionEngine* engine,
_inVarRegId(ExecutionNode::MaxRegisterId) { _inVarRegId(ExecutionNode::MaxRegisterId) {
auto it = en->getRegisterPlan()->varInfo.find(en->_inVariable->id); auto it = en->getRegisterPlan()->varInfo.find(en->_inVariable->id);
if (it == en->getRegisterPlan()->varInfo.end()){ if (it == en->getRegisterPlan()->varInfo.end()) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "variable not found"); THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "variable not found");
} }
_inVarRegId = (*it).second.registerId; _inVarRegId = (*it).second.registerId;
@ -1735,7 +1735,7 @@ AqlItemBlock* EnumerateListBlock::getSome (size_t, size_t atMost) {
_thisblock = 0; _thisblock = 0;
_seen = 0; _seen = 0;
// advance read position in the current block . . . // advance read position in the current block . . .
if (++_pos == cur->size() ) { if (++_pos == cur->size()) {
delete cur; delete cur;
_buffer.pop_front(); // does not throw _buffer.pop_front(); // does not throw
_pos = 0; _pos = 0;
@ -1757,7 +1757,7 @@ size_t EnumerateListBlock::skipSome (size_t atLeast, size_t atMost) {
size_t skipped = 0; size_t skipped = 0;
while ( skipped < atLeast ) { while (skipped < atLeast) {
if (_buffer.empty()) { if (_buffer.empty()) {
if (! ExecutionBlock::getBlock(DefaultBatchSize, DefaultBatchSize)) { if (! ExecutionBlock::getBlock(DefaultBatchSize, DefaultBatchSize)) {
_done = true; _done = true;
@ -1789,7 +1789,7 @@ size_t EnumerateListBlock::skipSome (size_t atLeast, size_t atMost) {
} }
case AqlValue::DOCVEC: { case AqlValue::DOCVEC: {
if( _index == 0) { // this is a (maybe) new DOCVEC if (_index == 0) { // this is a (maybe) new DOCVEC
_DOCVECsize = 0; _DOCVECsize = 0;
//we require the total number of items //we require the total number of items
for (size_t i = 0; i < inVarReg._vector->size(); i++) { for (size_t i = 0; i < inVarReg._vector->size(); i++) {
@ -1843,7 +1843,7 @@ AqlValue EnumerateListBlock::getAqlValue (AqlValue inVarReg) {
case AqlValue::DOCVEC: { // incoming doc vec has a single column case AqlValue::DOCVEC: { // incoming doc vec has a single column
AqlValue out = inVarReg._vector->at(_thisblock)->getValue(_index - AqlValue out = inVarReg._vector->at(_thisblock)->getValue(_index -
_seen, 0).clone(); _seen, 0).clone();
if(++_index == (inVarReg._vector->at(_thisblock)->size() + _seen)){ if (++_index == (inVarReg._vector->at(_thisblock)->size() + _seen)) {
_seen += inVarReg._vector->at(_thisblock)->size(); _seen += inVarReg._vector->at(_thisblock)->size();
_thisblock++; _thisblock++;
} }
@ -2233,7 +2233,7 @@ int FilterBlock::getOrSkipSome (size_t atLeast,
try { try {
result = AqlItemBlock::concatenate(collector); result = AqlItemBlock::concatenate(collector);
} }
catch (...){ catch (...) {
for (auto x : collector) { for (auto x : collector) {
delete x; delete x;
} }
@ -2402,7 +2402,7 @@ int AggregateBlock::getOrSkipSome (size_t atLeast,
if (newGroup) { if (newGroup) {
if (! _currentGroup.groupValues[0].isEmpty()) { if (! _currentGroup.groupValues[0].isEmpty()) {
if(! skipping){ if (! skipping) {
// need to emit the current group first // need to emit the current group first
emitGroup(cur, res.get(), skipped); emitGroup(cur, res.get(), skipped);
} }
@ -2449,7 +2449,7 @@ int AggregateBlock::getOrSkipSome (size_t atLeast,
// no more input. we're done // no more input. we're done
try { try {
// emit last buffered group // emit last buffered group
if(! skipping){ if (! skipping) {
emitGroup(cur, res.get(), skipped); emitGroup(cur, res.get(), skipped);
++skipped; ++skipped;
TRI_ASSERT(skipped > 0); TRI_ASSERT(skipped > 0);
@ -2480,7 +2480,7 @@ int AggregateBlock::getOrSkipSome (size_t atLeast,
} }
} }
if(! skipping){ if (! skipping) {
TRI_ASSERT(skipped > 0); TRI_ASSERT(skipped > 0);
res->shrink(skipped); res->shrink(skipped);
} }
@ -3523,7 +3523,7 @@ int GatherBlock::initializeCursor (AqlItemBlock* items, size_t pos) {
return res; return res;
} }
if (!_isSimple) { if (! _isSimple) {
for (std::deque<AqlItemBlock*>& x : _gatherBlockBuffer) { for (std::deque<AqlItemBlock*>& x : _gatherBlockBuffer) {
for (AqlItemBlock* y: x) { for (AqlItemBlock* y: x) {
delete y; delete y;
@ -3595,13 +3595,13 @@ bool GatherBlock::hasMore () {
if (_isSimple) { if (_isSimple) {
for (size_t i = 0; i < _dependencies.size(); i++) { for (size_t i = 0; i < _dependencies.size(); i++) {
if(_dependencies.at(i)->hasMore()) { if (_dependencies.at(i)->hasMore()) {
return true; return true;
} }
} }
} }
else { else {
for (size_t i = 0; i < _gatherBlockBuffer.size(); i++){ for (size_t i = 0; i < _gatherBlockBuffer.size(); i++) {
if (! _gatherBlockBuffer.at(i).empty()) { if (! _gatherBlockBuffer.at(i).empty()) {
return true; return true;
} }
@ -3899,7 +3899,7 @@ BlockWithClients::BlockWithClients (ExecutionEngine* engine,
: ExecutionBlock(engine, ep), : ExecutionBlock(engine, ep),
_nrClients(shardIds.size()), _nrClients(shardIds.size()),
_ignoreInitCursor(false), _ignoreInitCursor(false),
_ignoreShutdown(false){ _ignoreShutdown(false) {
_shardIdMap.reserve(_nrClients); _shardIdMap.reserve(_nrClients);
for (size_t i = 0; i < _nrClients; i++) { for (size_t i = 0; i < _nrClients; i++) {
@ -4176,7 +4176,7 @@ int ScatterBlock::getOrSkipSomeForShard (size_t atLeast,
skipped = (std::min)(available, atMost); //nr rows in outgoing block skipped = (std::min)(available, atMost); //nr rows in outgoing block
if (! skipping){ if (! skipping) {
result = _buffer.at(pos.first)->slice(pos.second, pos.second + skipped); result = _buffer.at(pos.first)->slice(pos.second, pos.second + skipped);
} }
@ -4349,7 +4349,7 @@ int DistributeBlock::getOrSkipSomeForShard (size_t atLeast,
skipped = (std::min)(buf.size(), atMost); skipped = (std::min)(buf.size(), atMost);
if (skipping) { if (skipping) {
for (size_t i = 0; i < skipped; i++){ for (size_t i = 0; i < skipped; i++) {
buf.pop_front(); buf.pop_front();
} }
freeCollector(); freeCollector();