mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Improve hashsocket() (for win32) to avoid collisions
Fixes: 91e3ead Refs: https://gist.github.com/azat/8a0a94e4de2d95af8f729b709589ce12
This commit is contained in:
parent
b456e4bd82
commit
ba0442bacc
2
evmap.c
2
evmap.c
@ -95,7 +95,7 @@ hashsocket(struct event_map_entry *e)
|
|||||||
* matter. Our hashtable implementation really likes low-order bits,
|
* matter. Our hashtable implementation really likes low-order bits,
|
||||||
* though, so let's do the rotate-and-add trick. */
|
* though, so let's do the rotate-and-add trick. */
|
||||||
unsigned h = (unsigned) e->fd;
|
unsigned h = (unsigned) e->fd;
|
||||||
h += (h >> 2) | (h << 30);
|
h = (h >> 2) | (h << 30);
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user