[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r16520: {tor} Nickm says I'm going to hell, but if I write that in a comme (tor/trunk/src/or)
Author: weasel
Date: 2008-08-13 08:45:15 -0400 (Wed, 13 Aug 2008)
New Revision: 16520
Modified:
tor/trunk/src/or/policies.c
Log:
Nickm says I'm going to hell, but if I write that in a comment he might just save my soul
Modified: tor/trunk/src/or/policies.c
===================================================================
--- tor/trunk/src/or/policies.c 2008-08-13 12:45:09 UTC (rev 16519)
+++ tor/trunk/src/or/policies.c 2008-08-13 12:45:15 UTC (rev 16520)
@@ -930,6 +930,7 @@
/** 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 @@
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 @@
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) {