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 <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2024-08-12 12:52:10 +03:00
parent 5dc266cefa
commit 7b5fe6bee6

View File

@@ -315,11 +315,7 @@ future<> sstable_directory::filesystem_components_lister::process(sstable_direct
abstract_lister::make<s3::client::bucket_lister>(_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);