From ba0442bacc4b5622b203226f7c96f3dff7a90977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C5=93ur?= Date: Sun, 5 May 2024 02:03:35 +0800 Subject: [PATCH] Improve hashsocket() (for win32) to avoid collisions Fixes: 91e3ead Refs: https://gist.github.com/azat/8a0a94e4de2d95af8f729b709589ce12 --- evmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evmap.c b/evmap.c index fd884ebc..4b899f34 100644 --- a/evmap.c +++ b/evmap.c @@ -95,7 +95,7 @@ hashsocket(struct event_map_entry *e) * matter. Our hashtable implementation really likes low-order bits, * though, so let's do the rotate-and-add trick. */ unsigned h = (unsigned) e->fd; - h += (h >> 2) | (h << 30); + h = (h >> 2) | (h << 30); return h; }