From df10a01af91d3df059c94113d7ba43a33baaa426 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Thu, 16 Jun 2022 09:30:21 +0200 Subject: [PATCH] flow: increase code coverage, simplify the internals --- src/entt/graph/flow.hpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/entt/graph/flow.hpp b/src/entt/graph/flow.hpp index 13e6ba0d0..4c68714a8 100644 --- a/src/entt/graph/flow.hpp +++ b/src/entt/graph/flow.hpp @@ -131,13 +131,8 @@ public: * @return This flow builder. */ basic_flow &task(id_type value) { - if(const auto it = vertices.find(value); it == vertices.cend()) { - index.first() = vertices.size(); - vertices.emplace(value); - } else { - index.first() = static_cast(it - vertices.cbegin()); - } - + const auto it = vertices.emplace(value).first; + index.first() = size_type(it - vertices.begin()); return *this; }