Replace pull_count_->did_pull_

This commit is contained in:
jeremy 2022-11-30 16:30:55 +01:00
parent 38f3a4cacb
commit 5e64b19745
2 changed files with 6 additions and 6 deletions

View File

@ -257,8 +257,8 @@ class DistributedCreateNodeCursor : public Cursor {
bool Once::OnceCursor::Pull(Frame &, ExecutionContext &context) {
SCOPED_PROFILE_OP("Once");
if (pull_count_ < 1) {
pull_count_++;
if (!did_pull_) {
did_pull_ = true;
return true;
}
return false;
@ -270,14 +270,14 @@ void Once::OnceCursor::PullMultiple(MultiFrame &multi_frame, ExecutionContext &c
auto iterator_for_valid_frame_only = multi_frame.GetValidFramesConsumer();
auto first_it = iterator_for_valid_frame_only.begin();
MG_ASSERT(first_it != iterator_for_valid_frame_only.end());
if (pull_count_ < 1) {
if (!did_pull_) {
auto *memory_resource = multi_frame.GetMemoryResource();
auto &frame = *first_it;
frame.MakeValid();
for (auto &value : frame.elems()) {
value = TypedValue{memory_resource};
}
pull_count_++;
did_pull_ = true;
}
}
@ -291,7 +291,7 @@ WITHOUT_SINGLE_INPUT(Once);
void Once::OnceCursor::Shutdown() {}
void Once::OnceCursor::Reset() { pull_count_ = 0; }
void Once::OnceCursor::Reset() { did_pull_ = false; }
CreateNode::CreateNode(const std::shared_ptr<LogicalOperator> &input, const NodeCreationInfo &node_info)
: input_(input ? input : std::make_shared<Once>()), node_info_(node_info) {}

View File

@ -341,7 +341,7 @@ and false on every following Pull.")
void Reset() override;
private:
size_t pull_count_{0};
bool did_pull_{false};
};
cpp<#)
(:serialize (:slk))