From 2a4fc8533cf059b48b6b509e91331d05ab388240 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 21 Feb 2007 05:56:53 +0000 Subject: r11858@catbus: nickm | 2007-02-21 00:27:44 -0500 As a trivial optimization, remove a redundant call to router_have_minimum_dir_info. This might shave 2% on some systems by according to some profilers. svn:r9610 --- src/or/circuituse.c | 5 ++++- src/or/routerlist.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 6cc7f54f07..e85b7c0b4a 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -445,7 +445,10 @@ circuit_build_needed_circs(time_t now) connection_ap_attach_pending(); /* make sure any hidden services have enough intro points */ - if (router_have_minimum_dir_info()) + /* XXXX012 circuit_build_needed_circs is only called at all if + * router_have_minimum_dir_info is true; this check is redundant, + * and it appears to show up on some people's profiles. */ + if (1 || router_have_minimum_dir_info()) rend_services_introduce(); if (time_to_new_circuit < now) { diff --git a/src/or/routerlist.c b/src/or/routerlist.c index dc3f85c941..76e34aa515 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -4154,7 +4154,7 @@ static int need_to_update_have_min_dir_info = 1; int router_have_minimum_dir_info(void) { - if (need_to_update_have_min_dir_info) { + if (PREDICT_FALSE(need_to_update_have_min_dir_info)) { update_router_have_minimum_dir_info(); need_to_update_have_min_dir_info = 0; } -- cgit v1.2.3-54-g00ecf