no need to use co_return at the end of a coroutine which returns
future<>. despite that this does not incur performance penalty,
because:
co_await func() // func returns future<>
returns void
co_return is called with void operand, this statement is lowered to
promise.return_void()
and a bare "co_await func()" also calls return_void(). so they are
equivalent at runtime. but the extraneous co_return can be dispensed.
also take this opportunity to remove the bare co_return at the end
of a coroutine. it's unnecessary just like a `return` at the end of
a function returning `void`.
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
co_await store.umount();
co_await store.stop();
- co_return;
}
seastar::future<> OSD::_write_superblock(
if (ret == 0) {
m->metadata["osd_objectstore"] = type;
}
- co_return co_await monc->send_message(std::move(m));
+ co_await monc->send_message(std::move(m));
}
seastar::future<> OSD::_add_device_class()
} else {
INFO("device_class was set: {}", message);
}
-
- co_return;
}
seastar::future<> OSD::_add_me_to_crush()