diff options
Diffstat (limited to 'src/server/PreProcessContext.hpp')
-rw-r--r-- | src/server/PreProcessContext.hpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/server/PreProcessContext.hpp b/src/server/PreProcessContext.hpp index fa7d07c5..7c97af3c 100644 --- a/src/server/PreProcessContext.hpp +++ b/src/server/PreProcessContext.hpp @@ -20,12 +20,10 @@ #include "CompiledGraph.hpp" #include "GraphImpl.hpp" -#include "raul/Maid.hpp" - +#include <memory> #include <unordered_set> -namespace ingen { -namespace server { +namespace ingen::server { /** Event pre-processing context. * @@ -50,12 +48,14 @@ public: bool must_compile(GraphImpl& graph) { if (!graph.enabled()) { return false; - } else if (_in_bundle) { + } + + if (_in_bundle) { _dirty_graphs.insert(&graph); return false; - } else { - return true; } + + return true; } /** Compile graph and return the result if necessary. @@ -63,13 +63,9 @@ public: * This may return null when an atomic bundle is deferring compilation, in * which case the graph is flagged as dirty for later compilation. */ - raul::Maid::managed_ptr<CompiledGraph> - maybe_compile(raul::Maid& maid, GraphImpl& graph) + [[nodiscard]] std::unique_ptr<CompiledGraph> maybe_compile(GraphImpl& graph) { - if (must_compile(graph)) { - return compile(maid, graph); - } - return nullptr; + return must_compile(graph) ? compile(graph) : nullptr; } /** Return all graphs that require compilation after an atomic bundle. */ @@ -81,7 +77,6 @@ private: bool _in_bundle = false; }; -} // namespace server -} // namespace ingen +} // namespace ingen::server #endif // INGEN_ENGINE_PREPROCESSCONTEXT_HPP |