From 7b5fe6bee663d6285e0a108c9cdfd1aef2e89247 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Mon, 12 Aug 2024 12:52:10 +0300 Subject: [PATCH] sstable_directory: Shorten lister loop Squash call to lister.get() and check for the returned value into while()'s condition. This saves few more lines of code as well. Signed-off-by: Pavel Emelyanov --- sstables/sstable_directory.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sstables/sstable_directory.cc b/sstables/sstable_directory.cc index 84898b1bf9..92de43a95f 100644 --- a/sstables/sstable_directory.cc +++ b/sstables/sstable_directory.cc @@ -315,11 +315,7 @@ future<> sstable_directory::filesystem_components_lister::process(sstable_direct abstract_lister::make(_client, _bucket, _directory.native() + "/", &manifest_json_filter); co_await with_closeable(std::move(lister), coroutine::lambda([this, &directory] (abstract_lister& lister) -> future<> { - while (true) { - auto de = co_await lister.get(); - if (!de) { - break; - } + while (auto de = co_await lister.get()) { auto component_path = _directory / de->name; auto comps = sstables::parse_path(component_path, directory._schema->ks_name(), directory._schema->cf_name()); handle(std::move(comps), component_path);