connection: Small simplification to wl_connection_write()

wl_connection_write() contained an exact copy of the logic in
wl_connection_queue().  Simplify things by just calling
wl_connection_queue() from wl_connection_write().

Signed-off-by: John Lindgren <john@jlindgren.net>
This commit is contained in:
John Lindgren 2022-02-28 08:54:47 -05:00 committed by Daniel Stone
parent 8c49ee3112
commit 9867bdb111

View file

@ -382,14 +382,7 @@ int
wl_connection_write(struct wl_connection *connection,
const void *data, size_t count)
{
if (connection->out.head - connection->out.tail +
count > ARRAY_LENGTH(connection->out.data)) {
connection->want_flush = 1;
if (wl_connection_flush(connection) < 0)
return -1;
}
if (ring_buffer_put(&connection->out, data, count) < 0)
if (wl_connection_queue(connection, data, count) < 0)
return -1;
connection->want_flush = 1;