summaryrefslogtreecommitdiff
path: root/ev.c
diff options
context:
space:
mode:
Diffstat (limited to 'ev.c')
-rw-r--r--ev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ev.c b/ev.c
index b576a86..5b8ba8d 100644
--- a/ev.c
+++ b/ev.c
@@ -810,6 +810,7 @@ downheap (WT *heap, int N, int k)
// find minimum child
if (expect_true (pos +3 < E))
{
+ /* fast path */
(minpos = pos + 0), (minat = (*minpos)->at);
if (pos [1]->at < minat) (minpos = pos + 1), (minat = (*minpos)->at);
if (pos [2]->at < minat) (minpos = pos + 2), (minat = (*minpos)->at);
@@ -817,9 +818,9 @@ downheap (WT *heap, int N, int k)
}
else
{
+ /* slow path */
if (pos >= E)
break;
-
(minpos = pos + 0), (minat = (*minpos)->at);
if (pos + 1 < E && pos [1]->at < minat) (minpos = pos + 1), (minat = (*minpos)->at);
if (pos + 2 < E && pos [2]->at < minat) (minpos = pos + 2), (minat = (*minpos)->at);