Refactor endsWith() to not use the STL

There's not really any reason for this function to use heap-allocated
strings. So I've refactored it to not do that.

I would've used SDL_strrstr(), if it existed. It does not appear to
exist. But that's okay.
This commit is contained in:
Misa
2021-02-26 15:29:37 -08:00
committed by Ethan Lee
parent 3171a97160
commit 5d4c1b7e9d
4 changed files with 11 additions and 11 deletions

View File

@@ -26,7 +26,7 @@ bool is_number(const char* str);
bool is_positive_num(const char* str, const bool hex);
bool endsWith(const std::string& str, const std::string& suffix);
bool endsWith(const char* str, const char* suffix);
#define INBOUNDS_VEC(index, vector) ((int) index >= 0 && (int) index < (int) vector.size())
#define INBOUNDS_ARR(index, array) ((int) index >= 0 && (int) index < (int) SDL_arraysize(array))