Skip to content

Commit 67d4a57

Browse files
committed
Remove excess explicit upcast and temporary UnboxedValuePod creation
commit_hash:cca2568fdd279c80e1af6d3c056c7bed92f690ca
1 parent 67f68ea commit 67d4a57

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

yql/essentials/minikql/comp_nodes/mkql_condense.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class TCondenseFlowWrapper : public TStatefulFlowCodegeneratorNode<TCondenseFlow
3030

3131
NUdf::TUnboxedValuePod DoCalculate(NUdf::TUnboxedValue& state, TComputationContext& ctx) const {
3232
if (state.IsFinish()) {
33-
return static_cast<const NUdf::TUnboxedValuePod&>(state);
33+
return state;
3434
}
3535

3636
if (state.IsInvalid()) {

yql/essentials/minikql/comp_nodes/mkql_condense1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class TCondense1FlowWrapper : public TStatefulFlowCodegeneratorNode<TCondense1Fl
3030

3131
NUdf::TUnboxedValuePod DoCalculate(NUdf::TUnboxedValue& state, TComputationContext& ctx) const {
3232
if (state.IsFinish()) {
33-
return static_cast<const NUdf::TUnboxedValuePod&>(state);
33+
return state;
3434
} else if (state.HasValue()) {
3535
if constexpr (UseCtx) {
3636
CleanupCurrentContext();

yql/essentials/minikql/comp_nodes/mkql_flatmap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ using TBaseComputation = TStatefulFlowCodegeneratorNode<TListFlatMapFlowWrapper>
219219
}
220220

221221
if (state.IsFinish()) {
222-
return NUdf::TUnboxedValuePod::MakeFinish();
222+
return state;
223223
}
224224

225225
while (true) {

yql/essentials/minikql/comp_nodes/mkql_multimap.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ class TFlowMultiMapWrapper : public TStatefulFlowCodegeneratorNode<TFlowMultiMap
2121
{}
2222

2323
NUdf::TUnboxedValuePod DoCalculate(NUdf::TUnboxedValue& state, TComputationContext& ctx) const {
24-
if (state.IsFinish())
25-
return NUdf::TUnboxedValuePod::MakeFinish();
24+
if (state.IsFinish()) {
25+
return state;
26+
}
2627

2728
const auto pos = state.IsInvalid() ? 0ULL : state.Get<ui64>();
2829
if (!pos) {
@@ -412,8 +413,9 @@ using TBaseComputation = TStatefulFlowCodegeneratorNode<TNarrowMultiMapWrapper>;
412413
{}
413414

414415
NUdf::TUnboxedValuePod DoCalculate(NUdf::TUnboxedValue& state, TComputationContext& ctx) const {
415-
if (state.IsFinish())
416-
return NUdf::TUnboxedValuePod::MakeFinish();
416+
if (state.IsFinish()) {
417+
return state;
418+
}
417419

418420
const auto pos = state.IsInvalid() ? 0ULL : state.Get<ui64>();
419421
if (!pos) {

yql/essentials/minikql/comp_nodes/mkql_squeeze_to_list.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class TSqueezeToListWrapper: public TStatefulFlowCodegeneratorNode<TSqueezeToLis
4747

4848
NUdf::TUnboxedValuePod DoCalculate(NUdf::TUnboxedValue& state, TComputationContext& ctx) const {
4949
if (state.IsFinish()) {
50-
return NUdf::TUnboxedValuePod::MakeFinish();
50+
return state;
5151
} else if (state.IsInvalid()) {
5252
MakeState(ctx, Limit->GetValue(ctx).GetOrDefault(std::numeric_limits<ui64>::max()), state);
5353
}

yt/yql/providers/yt/comp_nodes/dq/dq_yt_writer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class TYtDqWideWriteWrapper final : public TStatefulFlowCodegeneratorNode<TYtDqW
8787

8888
NUdf::TUnboxedValuePod DoCalculate(NUdf::TUnboxedValue& state, TComputationContext& ctx) const {
8989
if (state.IsFinish()) {
90-
return NUdf::TUnboxedValuePod::MakeFinish();
90+
return state;
9191
} else if (state.IsInvalid())
9292
MakeState(ctx, state);
9393

@@ -100,7 +100,7 @@ class TYtDqWideWriteWrapper final : public TStatefulFlowCodegeneratorNode<TYtDqW
100100
case EFetchResult::Finish:
101101
ptr->Finish();
102102
state = NUdf::TUnboxedValuePod::MakeFinish();
103-
return NUdf::TUnboxedValuePod::MakeFinish();
103+
return state;
104104
}
105105
}
106106
#ifndef MKQL_DISABLE_CODEGEN

0 commit comments

Comments
 (0)