@@ -28,19 +28,19 @@ class TSimpleStatefulWideFlowCodegeneratorNode
2828 }
2929
3030 EProcessResult DoProcessWrapper (NUdf::TUnboxedValue &state, TComputationContext& ctx, EFetchResult fetchRes, NUdf::TUnboxedValuePod* values, size_t width) const {
31- TVector<NUdf::TUnboxedValue> valuesVec (width, NUdf::TUnboxedValuePod ());
31+ TVector<NUdf::TUnboxedValuePod> inputVec (values, values + width);
32+ Fill (values, values + width, NUdf::TUnboxedValuePod ());
33+ TVector<NUdf::TUnboxedValue*> outputPtrsVec (width, nullptr );
3234 for (size_t pos = 0 ; pos < width; pos++) {
33- valuesVec [pos] = values[ pos] ;
35+ outputPtrsVec [pos] = static_cast <NUdf::TUnboxedValue*>( values + pos) ;
3436 }
35- TVector<NUdf::TUnboxedValue*> valuePtrsVec (width, nullptr );
37+ auto * const *inputPtrs = static_cast < const TDerived*>( this )-> PrepareInput (* static_cast <TState*>(state. GetRawPtr ()), ctx, outputPtrsVec. data () );
3638 for (size_t pos = 0 ; pos < width; pos++) {
37- valuePtrsVec[pos] = valuesVec.data () + pos;
39+ if (auto in = inputPtrs[pos]) {
40+ *in = inputVec[pos];
41+ }
3842 }
39- auto res = static_cast <const TDerived*>(this )->DoProcess (*static_cast <TState*>(state.GetRawPtr ()), ctx, fetchRes, valuePtrsVec.data ());
40- for (size_t pos = 0 ; pos < width; pos++) {
41- values[pos] = valuesVec[pos].Release ();
42- }
43- return res;
43+ return static_cast <const TDerived*>(this )->DoProcess (*static_cast <TState*>(state.GetRawPtr ()), ctx, fetchRes, outputPtrsVec.data ());
4444 }
4545
4646public:
0 commit comments