Skip to content

Commit 240c0a0

Browse files
authored
Merge pull request #591 from intel/lukevalenty/inline_flow_steps
encourage the compiler to inline flow steps
2 parents 875007c + 6441256 commit 240c0a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/flow/impl.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ class impl : public interface {
8181
/**
8282
* Execute the entire flow in order.
8383
*/
84-
auto operator()() const -> void final {
84+
__attribute__((flatten)) auto operator()() const -> void final {
8585
constexpr auto name =
8686
stdx::ct_string_to_type<Name, sc::string_constant>();
8787
if constexpr (loggingEnabled) {
8888
CIB_TRACE("flow.start({})", name);
8989
}
9090

91-
for (auto const func : functionPtrs) {
92-
func();
93-
}
91+
[this]<std::size_t... Is>(std::index_sequence<Is...>) {
92+
(functionPtrs[Is](), ...);
93+
}(std::make_index_sequence<capacity>{});
9494

9595
if constexpr (loggingEnabled) {
9696
CIB_TRACE("flow.end({})", name);

0 commit comments

Comments
 (0)