Christoph Mallon: Replace strlen(x) == 0 (O(n)) by x[0] == '\0' (O(1)).

This commit is contained in:
Sam Lantinga 2013-08-29 08:30:21 -07:00
parent 62d7359fd5
commit c6b7c0f507
12 changed files with 43 additions and 43 deletions

View file

@ -137,7 +137,7 @@ WIN_HasClipboardText(_THIS)
SDL_bool result = SDL_FALSE;
char *text = WIN_GetClipboardText(_this);
if (text) {
result = (SDL_strlen(text)>0) ? SDL_TRUE : SDL_FALSE;
result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
SDL_free(text);
}
return result;