diff options
author | root <root> | 2008-05-07 15:16:56 +0000 |
---|---|---|
committer | root <root> | 2008-05-07 15:16:56 +0000 |
commit | 7cab20ce227655a6e6fc21f39f43efc8ec5f7a98 (patch) | |
tree | 75e785950e3934d12e563853baef99fa9e3bd582 /ev.c | |
parent | cd7d60e294c5402f8dc10e46dcff788eaa280d7e (diff) |
*** empty log message ***
Diffstat (limited to 'ev.c')
-rw-r--r-- | ev.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -770,7 +770,8 @@ fd_rearm_all (EV_P) #define USE_4HEAP !EV_MINIMAL #if USE_4HEAP -#define HEAP0 3 /* index of first element in heap */ +#define DHEAP 4 +#define HEAP0 (DHEAP - 1) /* index of first element in heap */ /* towards the root */ void inline_speed @@ -780,7 +781,7 @@ upheap (WT *heap, int k) for (;;) { - int p = ((k - HEAP0 - 1) / 4) + HEAP0; + int p = ((k - HEAP0 - 1) / DHEAP) + HEAP0; if (p >= HEAP0 || heap [p]->at <= w->at) break; @@ -805,10 +806,10 @@ downheap (WT *heap, int N, int k) { ev_tstamp minat; WT *minpos; - WT *pos = heap + 4 * (k - HEAP0) + HEAP0; + WT *pos = heap + DHEAP * (k - HEAP0) + HEAP0; // find minimum child - if (expect_true (pos +3 < E)) + if (expect_true (pos + DHEAP - 1 < E)) { /* fast path */ (minpos = pos + 0), (minat = (*minpos)->at); |