(svn r8097) Replace strlen() {==,!=,>} 0 by the more concise {,!}StrEmpty(). Additionally the test takes O(1) instead of O(n) now
This commit is contained in:
@@ -47,6 +47,9 @@ typedef enum CharSetFilter {
|
||||
void strtolower(char *str);
|
||||
|
||||
|
||||
static inline bool StrEmpty(const char* s) { return s[0] == '\0'; }
|
||||
|
||||
|
||||
/** Get the length of a string, within a limited buffer */
|
||||
static inline int ttd_strnlen(const char *str, int maxlen)
|
||||
{
|
||||
|
Reference in New Issue
Block a user