From 05cf212e79728c2bf1449ee5cfdf7dd6b1a8c4fd Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 10 May 2022 15:47:05 +0200 Subject: refactor(minion): create request class --- minion/src/util.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'minion/src/util.cpp') diff --git a/minion/src/util.cpp b/minion/src/util.cpp index f587781..540a20c 100644 --- a/minion/src/util.cpp +++ b/minion/src/util.cpp @@ -3,7 +3,7 @@ namespace util { -bool str_ends_with(const char *str, const char *other_str) noexcept +auto str_ends_with(const char *str, const char *other_str) noexcept -> bool { if (str == nullptr || other_str == nullptr) { @@ -25,11 +25,16 @@ void substr(const char *str, const char *end, char *dest) noexcept { auto *dest_head = dest; - for (const char *char_ptr = str; char_ptr + 1 != end; ++char_ptr) + for (const char *char_ptr = str; char_ptr != end; ++char_ptr) { *dest_head = *char_ptr; dest_head++; } } +auto streq(const char *str_one, const char *str_two) noexcept -> bool +{ + return strcmp(str_one, str_two) == 0; +} + } // namespace util -- cgit v1.2.3-18-g5258