From 099b4e41367c108122153c32d94f504f7647f60c Mon Sep 17 00:00:00 2001 From: Username404 Date: Wed, 22 Dec 2021 20:38:36 +0100 Subject: [PATCH] Remove redundant optional usage in Target.hpp --- src/headers/transpiler/Target.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/headers/transpiler/Target.hpp b/src/headers/transpiler/Target.hpp index 907e629..8d3f6b2 100644 --- a/src/headers/transpiler/Target.hpp +++ b/src/headers/transpiler/Target.hpp @@ -68,7 +68,7 @@ protected: typedef function task; #define make_task_base(type, captures, function_body) make_pair(type_index(typeid(type)), [captures](const ParseTree& parsedTree, unsigned int& index) { const type& parseComponent = pointerAs(parsedTree[index]); function_body }) #define make_task(T, F) make_task_base(T, this, F) - typedef unordered_map> unordered_task_map; + typedef unordered_map unordered_task_map; virtual unordered_task_map getTaskMap() = 0; public: const unordered_task_map& getTaskMapInstance() { @@ -93,8 +93,8 @@ public: const unique_ptr& component = tree[i]; const type_info& id = component->getId(); try { - const optional& currentTask = taskMap.at(id); - if (currentTask.has_value()) currentTask.value()(tree, i); + const task& currentTask = taskMap.at(id); + currentTask(tree, i); } catch (const out_of_range&) { throw Yerbacon::Exception(string( #ifndef __GNUC__