projects
/
m6w6
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
| inline |
side by side
(parent:
8c44ea2
)
libmemcached: fix #41 (ensure stable sort on host key collision)
author
Michael Wallner
<mike@php.net>
Tue, 21 Jan 2020 16:38:13 +0000
(17:38 +0100)
committer
Michael Wallner
<mike@php.net>
Tue, 21 Jan 2020 16:38:13 +0000
(17:38 +0100)
libmemcached/hosts.cc
patch
|
blob
|
history
diff --git
a/libmemcached/hosts.cc
b/libmemcached/hosts.cc
index 97f7c35b74d50ddd15fbd8169a02403f3520dec5..98cb3f7d48dc777c1d4ca18f1c3f75b7a471f771 100644
(file)
--- a/
libmemcached/hosts.cc
+++ b/
libmemcached/hosts.cc
@@
-120,7
+120,18
@@
static int continuum_item_cmp(const void *t1, const void *t2)
WATCHPOINT_ASSERT(ct1->value != 153);
if (ct1->value == ct2->value)
{
- return 0;
+ if (ct1->index == ct2->index)
+ {
+ return 0;
+ }
+ else if (ct1->index > ct2->index)
+ {
+ return 1;
+ }
+ else
+ {
+ return -1;
+ }
}
else if (ct1->value > ct2->value)
{