Reverse condition in while() + comment

This commit is contained in:
jeremy 2022-11-30 14:50:28 +01:00
parent 969b8f0da7
commit 072bc58b1e
2 changed files with 13 additions and 3 deletions

View File

@ -16,6 +16,16 @@
namespace memgraph::query::v2 { namespace memgraph::query::v2 {
// #NoCommit uncomment https://github.com/memgraph/memgraph/pull/676#discussion_r1035704661
// static_assert(std::forward_iterator<ValidFramesReader::Iterator> &&
// std::equality_comparable<ValidFramesReader::Iterator>);
// static_assert(std::forward_iterator<ValidFramesModifier::Iterator> &&
// std::equality_comparable<ValidFramesModifier::Iterator>);
// static_assert(std::forward_iterator<ValidFramesConsumer::Iterator> &&
// std::equality_comparable<ValidFramesConsumer::Iterator>);
// static_assert(std::forward_iterator<InvalidFramesPopulator::Iterator> &&
// std::equality_comparable<InvalidFramesPopulator::Iterator>);
MultiFrame::MultiFrame(FrameWithValidity default_frame, size_t number_of_frames, MultiFrame::MultiFrame(FrameWithValidity default_frame, size_t number_of_frames,
utils::MemoryResource *execution_memory) utils::MemoryResource *execution_memory)
: default_frame_(default_frame), : default_frame_(default_frame),

View File

@ -113,7 +113,7 @@ class ValidFramesReader {
Iterator &operator++() { Iterator &operator++() {
do { do {
ptr_++; ptr_++;
} while (!this->ptr_->IsValid() && *this != iterator_wrapper_.end()); } while (*this != iterator_wrapper_.end() && !this->ptr_->IsValid());
return *this; return *this;
} }
@ -160,7 +160,7 @@ class ValidFramesModifier {
Iterator &operator++() { Iterator &operator++() {
do { do {
ptr_++; ptr_++;
} while (!this->ptr_->IsValid() && *this != iterator_wrapper_.end()); } while (*this != iterator_wrapper_.end() && !this->ptr_->IsValid());
return *this; return *this;
} }
@ -207,7 +207,7 @@ class ValidFramesConsumer {
Iterator &operator++() { Iterator &operator++() {
do { do {
ptr_++; ptr_++;
} while (!this->ptr_->IsValid() && *this != iterator_wrapper_.end()); } while (*this != iterator_wrapper_.end() && !this->ptr_->IsValid());
return *this; return *this;
} }