mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-11 22:42:31 +02:00
Christoph Mallon: Remove pointless if (x) before SDL_free(x)
This commit is contained in:
@@ -72,9 +72,7 @@ SDL_SetHintWithPriority(const char *name, const char *value,
|
||||
entry->callback(entry->userdata, name, hint->value, value);
|
||||
entry = next;
|
||||
}
|
||||
if (hint->value) {
|
||||
SDL_free(hint->value);
|
||||
}
|
||||
SDL_free(hint->value);
|
||||
hint->value = value ? SDL_strdup(value) : NULL;
|
||||
}
|
||||
hint->priority = priority;
|
||||
@@ -206,9 +204,7 @@ void SDL_ClearHints(void)
|
||||
SDL_hints = hint->next;
|
||||
|
||||
SDL_free(hint->name);
|
||||
if (hint->value) {
|
||||
SDL_free(hint->value);
|
||||
}
|
||||
SDL_free(hint->value);
|
||||
for (entry = hint->callbacks; entry; ) {
|
||||
SDL_HintWatch *freeable = entry;
|
||||
entry = entry->next;
|
||||
|
||||
Reference in New Issue
Block a user