From 49c093dc62ffcea290f0257e9450acc8885c639c Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Wed, 5 Apr 2023 11:20:52 -0400 Subject: [PATCH] [Cleanup] Remove always true statement in say_link.cpp (#3188) # Notes - This is always true since we check `!saylinks.empty()` prior to this. --- common/say_link.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/common/say_link.cpp b/common/say_link.cpp index 704ed620c..5ac7b7c94 100644 --- a/common/say_link.cpp +++ b/common/say_link.cpp @@ -403,16 +403,14 @@ SaylinkRepository::Saylink EQ::SayLinkEngine::GetOrSaveSaylink(std::string sayli } // if not found in database - save - if (saylinks.empty()) { - auto new_saylink = SaylinkRepository::NewEntity(); - new_saylink.phrase = saylink_text; + auto new_saylink = SaylinkRepository::NewEntity(); + new_saylink.phrase = saylink_text; - // persist to database - auto link = SaylinkRepository::InsertOne(database, new_saylink); - if (link.id > 0) { - g_cached_saylinks.emplace_back(link); - return link; - } + // persist to database + auto link = SaylinkRepository::InsertOne(database, new_saylink); + if (link.id > 0) { + g_cached_saylinks.emplace_back(link); + return link; } return {};