Skip to content

Commit d99f5c5

Browse files
authored
Fix style: remove excess casts (#3335)
1 parent e2b55a1 commit d99f5c5

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

ydb/library/yql/dq/runtime/dq_input_impl.h

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,15 @@ class TDqInputImpl : public IInputInterface {
144144

145145
StoredBytes += space;
146146
StoredRows += batch.RowCount();
147-
148-
if (static_cast<TDerived*>(this)->PushStats.CollectBasic()) {
149-
static_cast<TDerived*>(this)->PushStats.Bytes += space;
150-
static_cast<TDerived*>(this)->PushStats.Rows += GetRowsCount(batch);
151-
static_cast<TDerived*>(this)->PushStats.Chunks++;
152-
static_cast<TDerived*>(this)->PushStats.Resume();
153-
if (static_cast<TDerived*>(this)->PushStats.CollectFull()) {
154-
static_cast<TDerived*>(this)->PushStats.MaxMemoryUsage = std::max(static_cast<TDerived*>(this)->PushStats.MaxMemoryUsage, StoredBytes);
147+
auto& pushStats = static_cast<TDerived*>(this)->PushStats;
148+
149+
if (pushStats.CollectBasic()) {
150+
pushStats.Bytes += space;
151+
pushStats.Rows += GetRowsCount(batch);
152+
pushStats.Chunks++;
153+
pushStats.Resume();
154+
if (pushStats.CollectFull()) {
155+
pushStats.MaxMemoryUsage = std::max(pushStats.MaxMemoryUsage, StoredBytes);
155156
}
156157
}
157158

@@ -172,7 +173,9 @@ class TDqInputImpl : public IInputInterface {
172173

173174
batch.clear();
174175

175-
static_cast<TDerived*>(this)->PopStats.Resume(); //save timing before processing
176+
auto& popStats = static_cast<TDerived*>(this)->PopStats;
177+
178+
popStats.Resume(); //save timing before processing
176179
ui64 popBytes = 0;
177180

178181
if (IsPaused()) {
@@ -228,10 +231,10 @@ class TDqInputImpl : public IInputInterface {
228231
Batches.clear();
229232
}
230233

231-
if (static_cast<TDerived*>(this)->PopStats.CollectBasic()) {
232-
static_cast<TDerived*>(this)->PopStats.Bytes += popBytes;
233-
static_cast<TDerived*>(this)->PopStats.Rows += GetRowsCount(batch);
234-
static_cast<TDerived*>(this)->PopStats.Chunks++;
234+
if (popStats.CollectBasic()) {
235+
popStats.Bytes += popBytes;
236+
popStats.Rows += GetRowsCount(batch);
237+
popStats.Chunks++;
235238
}
236239

237240
Y_ABORT_UNLESS(!batch.empty());

0 commit comments

Comments
 (0)