From 4a7765fc35447ebe9857814b4de18c87f5847e52 Mon Sep 17 00:00:00 2001 From: Th3maz1ng Date: Sun, 17 Apr 2022 21:33:27 +0200 Subject: [PATCH] Removed the lastIndexOf function returning the last occurence of a character in a string, using builtin strrchr instead --- src/app/utilities.cpp | 18 ------------------ src/app/utilities.h | 1 - 2 files changed, 19 deletions(-) diff --git a/src/app/utilities.cpp b/src/app/utilities.cpp index 474b9f0..3eed40a 100644 --- a/src/app/utilities.cpp +++ b/src/app/utilities.cpp @@ -50,24 +50,6 @@ char *dateTimeFormater(char *pointer, const uint8_t value, const char character) return pointer; } -char *lastIndexOf(char *str, const char character) -{ - char *last(NULL), *current(str); - do - { - current = strchr(current, character); - if(current != NULL) - { - last = current; - if(*(current+1) == '\0')break; - - current += 1; - } - }while(current != NULL); - - return last; -} - /** * The monthNumTo3LetterAbbreviation function takes the month number from 1 to 12 and returns the abbreviation in a 3 letter * format. diff --git a/src/app/utilities.h b/src/app/utilities.h index 8383c0c..f429317 100644 --- a/src/app/utilities.h +++ b/src/app/utilities.h @@ -3,7 +3,6 @@ #include char *addChar(char *pointer, const char character); -char *lastIndexOf(char *str, const char character); char *dateTimeFormater(char *pointer, const uint8_t value, const char character); uint32_t monthNumTo3LetterAbbreviation(const uint8_t monthNumber); #endif // UTILITIES_H