From 2809f92eeb8b727e20167fe82e4cb9c3627d4870 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 8 May 2022 18:55:42 +0200 Subject: chore: move most files to minion folder --- src/util.cpp | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 src/util.cpp (limited to 'src/util.cpp') diff --git a/src/util.cpp b/src/util.cpp deleted file mode 100644 index f587781..0000000 --- a/src/util.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "util.hpp" - -namespace util -{ - -bool str_ends_with(const char *str, const char *other_str) noexcept -{ - if (str == nullptr || other_str == nullptr) - { - return false; - } - - auto str_length = strlen(str); - auto other_str_length = strlen(other_str); - - if (other_str_length > str_length) - { - return false; - } - - return strncmp(str + str_length - other_str_length, other_str, other_str_length) == 0; -} - -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) - { - *dest_head = *char_ptr; - dest_head++; - } -} - -} // namespace util -- cgit v1.2.3-18-g5258