From 8447e3ff554675c3e24c5816e60dd0ee88a9ccb2 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 28 Apr 2015 08:44:21 +1000 Subject: [PATCH] Microoptimise --- src/connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connector.c b/src/connector.c index 89017590..ae768f8b 100644 --- a/src/connector.c +++ b/src/connector.c @@ -358,7 +358,7 @@ retry: /* This read call is non-blocking since the socket is set to O_NOBLOCK */ ret = read(client->fd, client->buf + client->bufofs, buflen); if (ret < 1) { - if (errno == EAGAIN || errno == EWOULDBLOCK || !ret) + if (likely(errno == EAGAIN || errno == EWOULDBLOCK || !ret)) return; LOGINFO("Client fd %d disconnected - recv fail with bufofs %d ret %d errno %d %s", client->fd, client->bufofs, ret, errno, ret && errno ? strerror(errno) : "");