gmain: remove unnecessary initialization of *timeout in prepare() callbacks

Note that the prepare callback only has one caller, which pre-initializes
the timeout argument to -1. That may be an implementation detail and not
publicly promised, but it wouldn't make sense to do it any other way in
the caller.

Also, note that g_unix_signal_watch_prepare() and the UNIX branch of
g_child_watch_prepare() already relied on that.
This commit is contained in:
Thomas Haller
2023-05-17 08:15:16 +02:00
parent 30b5418608
commit cdda194844
5 changed files with 2 additions and 7 deletions

View File

@@ -4003,8 +4003,6 @@ socket_source_prepare (GSource *source,
{
GSocketSource *socket_source = (GSocketSource *)source;
*timeout = -1;
#ifdef G_OS_WIN32
if ((socket_source->pollfd.revents & G_IO_NVAL) != 0)
return TRUE;