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) { bool Once::OnceCursor::Pull(Frame &, ExecutionContext &context) {
SCOPED_PROFILE_OP("Once"); SCOPED_PROFILE_OP("Once");
if (pull_count_ < 1) { if (!did_pull_) {
pull_count_++; did_pull_ = true;
return true; return true;
} }
return false; 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 iterator_for_valid_frame_only = multi_frame.GetValidFramesConsumer();
auto first_it = iterator_for_valid_frame_only.begin(); auto first_it = iterator_for_valid_frame_only.begin();
MG_ASSERT(first_it != iterator_for_valid_frame_only.end()); MG_ASSERT(first_it != iterator_for_valid_frame_only.end());
if (pull_count_ < 1) { if (!did_pull_) {
auto *memory_resource = multi_frame.GetMemoryResource(); auto *memory_resource = multi_frame.GetMemoryResource();
auto &frame = *first_it; auto &frame = *first_it;
frame.MakeValid(); frame.MakeValid();
for (auto &value : frame.elems()) { for (auto &value : frame.elems()) {
value = TypedValue{memory_resource}; value = TypedValue{memory_resource};
} }
pull_count_++; did_pull_ = true;
} }
} }
@ -291,7 +291,7 @@ WITHOUT_SINGLE_INPUT(Once);
void Once::OnceCursor::Shutdown() {} 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) CreateNode::CreateNode(const std::shared_ptr<LogicalOperator> &input, const NodeCreationInfo &node_info)
: input_(input ? input : std::make_shared<Once>()), node_info_(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; void Reset() override;
private: private:
size_t pull_count_{0}; bool did_pull_{false};
}; };
cpp<#) cpp<#)
(:serialize (:slk)) (:serialize (:slk))