From 7eaf5bd848791601be14873f8809a55cfa7f1c7d Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 13 Aug 2008 12:45:15 +0000 Subject: [PATCH] Nickm says I'm going to hell, but if I write that in a comment he might just save my soul svn:r16520 --- src/or/policies.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/or/policies.c b/src/or/policies.c index dd0f24fd52..918e941933 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -930,6 +930,7 @@ policy_summary_item_t* policy_summary_item_split(policy_summary_item_t* old, uin /** Create a new exit policy summary, initially only with a single * port 1-64k item */ +/* XXXX This entire thing is O(N^2). Use an RB-tree if that turns out to matter. */ smartlist_t * policy_summary_create(void) { @@ -971,7 +972,10 @@ policy_summary_item_split(policy_summary_item_t* old, uint16_t new_starts) { return new; } +/* XXXX Nick says I'm going to hell for this. If he feels charitably towards + * my immortal soul, he can clean it up himself. */ #define AT(x) ((policy_summary_item_t*)smartlist_get(summary, x)) + #define REJECT_CUTOFF_COUNT (1<<25) /* Split an exit policy summary so that prt_min and prt_max * fall at exactly the start and end of an item respectively. @@ -983,6 +987,7 @@ policy_summary_split(smartlist_t *summary, int start_at_index; int i = 0; + /* XXXX Do a binary search if run time matters */ while (AT(i)->prt_max < prt_min) i++; if (AT(i)->prt_min != prt_min) { -- 2.11.4.GIT