From 3ab071403d6f46cb61fb9fdb8f6ec3b0122cb5c5 Mon Sep 17 00:00:00 2001 From: Folling Date: Mon, 12 Feb 2024 15:36:44 +0100 Subject: [PATCH] invert condition for whether name is unique Signed-off-by: Folling --- src/ikarus/objects/util.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ikarus/objects/util.hpp b/src/ikarus/objects/util.hpp index 8e037ca..4b55caa 100644 --- a/src/ikarus/objects/util.hpp +++ b/src/ikarus/objects/util.hpp @@ -63,7 +63,7 @@ template project->db->query_one("SELECT EXISTS(SELECT 1 FROM `blueprints` WHERE `name` = ?)", name) ); - return exists; + return !exists; } [[nodiscard]] inline bool name_is_unique( @@ -80,7 +80,7 @@ template project->db->query_one("SELECT EXISTS(SELECT 1 FROM `entities` WHERE `name` = ?)", name) ); - return exists; + return !exists; } [[nodiscard]] inline bool @@ -93,7 +93,7 @@ name_is_unique(IkarusProject const * project, std::string_view name, IkarusPrope project->db->query_one("SELECT EXISTS(SELECT 1 FROM `properties` WHERE `name` = ? AND `scope` = ?)", name, scope->get_id()) ); - return exists; + return !exists; } [[nodiscard]] inline bool