Skip to content

Commit 887fe7f

Browse files
authored
Simplify TSubOperation (#10211)
1 parent b8ac272 commit 887fe7f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ydb/core/tx/schemeshard/schemeshard__operation_part.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static TString LogMessage(const TString& ev, TOperationContext& context, bool ig
8989
} \
9090
\
9191
bool TSubOperation::HandleReply(TEvType::TPtr& ev, TOperationContext& context) { \
92-
return Progress(context, &ISubOperationState::HandleReply, ev, context); \
92+
return Progress(context, &ISubOperationState::HandleReply, ev); \
9393
}
9494

9595
SCHEMESHARD_INCOMING_EVENTS(DefaultHandleReply)

ydb/core/tx/schemeshard/schemeshard__operation_part.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class TSubOperation: public TSubOperationBase {
278278
}
279279

280280
bool ProgressState(TOperationContext& context) override {
281-
return Progress(context, &ISubOperationState::ProgressState, context);
281+
return Progress(context, &ISubOperationState::ProgressState);
282282
}
283283

284284
#define DefaultHandleReply(TEvType, ...) \
@@ -292,9 +292,9 @@ class TSubOperation: public TSubOperationBase {
292292
using TFunc = bool(ISubOperationState::*)(Args...);
293293

294294
template <typename... Args>
295-
bool Progress(TOperationContext& context, TFunc<Args...> func, Args&&... args) {
295+
bool Progress(TOperationContext& context, TFunc<Args..., TOperationContext&> func, Args&&... args) {
296296
Y_ABORT_UNLESS(StateFunc);
297-
const bool isDone = std::invoke(func, StateFunc.Get(), std::forward<Args>(args)...);
297+
const bool isDone = std::invoke(func, StateFunc.Get(), std::forward<Args>(args)..., context);
298298
if (isDone) {
299299
StateDone(context);
300300
}

0 commit comments

Comments
 (0)