mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-05 10:38:08 +01:00
gmain: remove unnecessary initialization of source_timeout in g_main_context_prepare_unlocked()
Note that the variable source_timeout is already initialized upon definition, at the beginning of the block. It's easy to see, that no code changes the variable between the variable definition, and the place where it was initialized. It was thus unnecessary. It's not about dropping the unnecessary code (the compiler could do that just fine too). It's that there is the other branch of the "if/else", where the variable is also not initialized. But the other branch also requires that the variable is in fact initialized to -1, because prepare() callbacks are free not to explicitly set the output value. So both branches require the variable to be initialized to -1, but only one of them did. This poses unnecessary questions about whether anything is wrong. Avoid that by dropping the redundant code.
This commit is contained in:
parent
a71b0c0461
commit
30b5418608
@ -3855,10 +3855,7 @@ g_main_context_prepare_unlocked (GMainContext *context,
|
||||
context->in_check_or_prepare--;
|
||||
}
|
||||
else
|
||||
{
|
||||
source_timeout = -1;
|
||||
result = FALSE;
|
||||
}
|
||||
result = FALSE;
|
||||
|
||||
if (result == FALSE && source->priv->ready_time != -1)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user