From 7e6e47b19122399c07ee9e4b06db9c46d24735d0 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 18 Jan 2021 08:20:39 +0100 Subject: [PATCH] Simplify captcha_valid(). --- src/cgi.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cgi.cpp b/src/cgi.cpp index 255e096..da1c136 100644 --- a/src/cgi.cpp +++ b/src/cgi.cpp @@ -200,11 +200,7 @@ string text2html(string text) bool captcha_valid(std::uint8_t id, const string_view answer) { std::array answers{"2", "6", "17", "12", "4", "1"}; - if (answers.at(id) == answer) - { - return true; - } - return false; + return answers.at(id) == answer; } bool is_spam(const entry_type &entry)