Remove "is this too slow?" XXXX comments for code not appearing in profiles

This commit is contained in:
Nick Mathewson 2010-10-15 11:21:33 -04:00
parent a5289fa794
commit 247ce5876a
4 changed files with 2 additions and 12 deletions

View File

@ -3032,8 +3032,6 @@ choose_good_entry_server(uint8_t purpose, cpath_build_state_t *state)
nodelist_add_node_family(excluded, node); nodelist_add_node_family(excluded, node);
} }
if (firewall_is_fascist_or()) { if (firewall_is_fascist_or()) {
/*XXXX This could slow things down a lot; use a smarter implementation */
/* exclude all ORs that listen on the wrong port, if anybody notices. */
smartlist_t *nodes = nodelist_get_list(); smartlist_t *nodes = nodelist_get_list();
SMARTLIST_FOREACH(nodes, const node_t *,node, { SMARTLIST_FOREACH(nodes, const node_t *,node, {
if (!fascist_firewall_allows_node(node)) if (!fascist_firewall_allows_node(node))

View File

@ -971,7 +971,7 @@ networkstatus_vote_find_entry(networkstatus_t *ns, const char *digest)
return networkstatus_vote_find_mutable_entry(ns, digest); return networkstatus_vote_find_mutable_entry(ns, digest);
} }
/*XXXX make this static once functions are moved into this file. */ /*XXXX MOVE make this static once functions are moved into this file. */
/** Search the routerstatuses in <b>ns</b> for one whose identity digest is /** Search the routerstatuses in <b>ns</b> for one whose identity digest is
* <b>digest</b>. Return value and set *<b>found_out</b> as for * <b>digest</b>. Return value and set *<b>found_out</b> as for
* smartlist_bsearch_idx(). */ * smartlist_bsearch_idx(). */
@ -2031,7 +2031,6 @@ routers_update_status_from_consensus_networkstatus(smartlist_t *routers,
} SMARTLIST_FOREACH_JOIN_END(rs, router); } SMARTLIST_FOREACH_JOIN_END(rs, router);
/* Now update last_listed_as_valid_until from v2 networkstatuses. */ /* Now update last_listed_as_valid_until from v2 networkstatuses. */
/* XXXX If this is slow, we need to rethink the code. */
SMARTLIST_FOREACH(networkstatus_v2_list, networkstatus_v2_t *, ns, { SMARTLIST_FOREACH(networkstatus_v2_list, networkstatus_v2_t *, ns, {
time_t live_until = ns->published_on + V2_NETWORKSTATUS_ROUTER_LIFETIME; time_t live_until = ns->published_on + V2_NETWORKSTATUS_ROUTER_LIFETIME;
SMARTLIST_FOREACH_JOIN(ns->entries, const routerstatus_t *, rs, SMARTLIST_FOREACH_JOIN(ns->entries, const routerstatus_t *, rs,

View File

@ -1088,7 +1088,7 @@ policy_summary_split(smartlist_t *summary,
int start_at_index; int start_at_index;
int i = 0; int i = 0;
/* XXXX Do a binary search if run time matters */
while (AT(i)->prt_max < prt_min) while (AT(i)->prt_max < prt_min)
i++; i++;
if (AT(i)->prt_min != prt_min) { if (AT(i)->prt_min != prt_min) {

View File

@ -2656,7 +2656,6 @@ routerinfo_free(routerinfo_t *router)
} }
addr_policy_list_free(router->exit_policy); addr_policy_list_free(router->exit_policy);
/* XXXX Remove if this turns out to affect performance. */
memset(router, 77, sizeof(routerinfo_t)); memset(router, 77, sizeof(routerinfo_t));
tor_free(router); tor_free(router);
@ -2671,7 +2670,6 @@ extrainfo_free(extrainfo_t *extrainfo)
tor_free(extrainfo->cache_info.signed_descriptor_body); tor_free(extrainfo->cache_info.signed_descriptor_body);
tor_free(extrainfo->pending_sig); tor_free(extrainfo->pending_sig);
/* XXXX remove this if it turns out to slow us down. */
memset(extrainfo, 88, sizeof(extrainfo_t)); /* debug bad memory usage */ memset(extrainfo, 88, sizeof(extrainfo_t)); /* debug bad memory usage */
tor_free(extrainfo); tor_free(extrainfo);
} }
@ -2685,7 +2683,6 @@ signed_descriptor_free(signed_descriptor_t *sd)
tor_free(sd->signed_descriptor_body); tor_free(sd->signed_descriptor_body);
/* XXXX remove this once more bugs go away. */
memset(sd, 99, sizeof(signed_descriptor_t)); /* Debug bad mem usage */ memset(sd, 99, sizeof(signed_descriptor_t)); /* Debug bad mem usage */
tor_free(sd); tor_free(sd);
} }
@ -2787,7 +2784,6 @@ routerlist_insert(routerlist_t *rl, routerinfo_t *ri)
{ {
routerinfo_t *ri_old; routerinfo_t *ri_old;
{ {
/* XXXX Remove if this slows us down. */
const routerinfo_t *ri_generated = router_get_my_routerinfo(); const routerinfo_t *ri_generated = router_get_my_routerinfo();
tor_assert(ri_generated != ri); tor_assert(ri_generated != ri);
} }
@ -2823,7 +2819,6 @@ extrainfo_insert(routerlist_t *rl, extrainfo_t *ei)
extrainfo_t *ei_tmp; extrainfo_t *ei_tmp;
{ {
/* XXXX remove this code if it slows us down. */
extrainfo_t *ei_generated = router_get_my_extrainfo(); extrainfo_t *ei_generated = router_get_my_extrainfo();
tor_assert(ei_generated != ei); tor_assert(ei_generated != ei);
} }
@ -2869,7 +2864,6 @@ static void
routerlist_insert_old(routerlist_t *rl, routerinfo_t *ri) routerlist_insert_old(routerlist_t *rl, routerinfo_t *ri)
{ {
{ {
/* XXXX remove this code if it slows us down. */
const routerinfo_t *ri_generated = router_get_my_routerinfo(); const routerinfo_t *ri_generated = router_get_my_routerinfo();
tor_assert(ri_generated != ri); tor_assert(ri_generated != ri);
} }
@ -3022,7 +3016,6 @@ routerlist_replace(routerlist_t *rl, routerinfo_t *ri_old,
routerinfo_t *ri_tmp; routerinfo_t *ri_tmp;
extrainfo_t *ei_tmp; extrainfo_t *ei_tmp;
{ {
/* XXXX Remove this if it turns out to slow us down. */
const routerinfo_t *ri_generated = router_get_my_routerinfo(); const routerinfo_t *ri_generated = router_get_my_routerinfo();
tor_assert(ri_generated != ri_new); tor_assert(ri_generated != ri_new);
} }