From 4f293b584f1e466513a478014e116b3f058eaee8 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 11 Apr 2016 14:01:25 +0100 Subject: [PATCH] [Fix] Priority of sink/swim should be reversed --- src/libutil/heap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libutil/heap.c b/src/libutil/heap.c index 6fc1d9783..f5084e4b0 100644 --- a/src/libutil/heap.c +++ b/src/libutil/heap.c @@ -150,11 +150,11 @@ rspamd_min_heap_update_elt (struct rspamd_min_heap *heap, oldpri = elt->pri; elt->pri = npri; - if (oldpri > npri) { + if (npri > oldpri) { /* We might need to sink */ rspamd_min_heap_sink (heap, elt); } - else if (oldpri < npri) { + else if (npri < oldpri) { /* We might need to swim */ rspamd_min_heap_swim (heap, elt); } -- 2.39.5