From 3e785bc16a83875861bf01745356bd6cc311cfb4 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 5 Nov 2020 12:46:52 +0800 Subject: [PATCH] crimson/common: refactor crimson::do_until() * define `errorator_t` instead of `futurator` to simplify the code a little bit. * use seastar helper function / types when appropriate Signed-off-by: Kefu Chai --- src/crimson/common/errorator.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index 7c6f9fe20ad39..002c158dc7f8f 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -49,24 +49,24 @@ inline auto do_for_each(Container& c, AsyncAction action) { template inline auto do_until(AsyncAction action) { - using futurator = \ - ::seastar::futurize>; + using errorator_t = + typename ::seastar::futurize_t>::errorator_type; while (true) { - auto f = futurator::invoke(action); + auto f = ::seastar::futurize_invoke(action); if (f.failed()) { - return futurator::type::errorator_type::template make_exception_future2<>( + return errorator_t::template make_exception_future2<>( f.get_exception() ); } else if (f.available()) { if (auto done = f.get0()) { - return futurator::type::errorator_type::template make_ready_future<>(); + return errorator_t::template make_ready_future<>(); } } else { return std::move(f)._then( [action = std::move(action)] (auto &&done) mutable { if (done) { - return futurator::type::errorator_type::template make_ready_future<>(); + return errorator_t::template make_ready_future<>(); } return ::crimson::do_until( std::move(action)); -- 2.39.5