aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-09-19 22:20:09 +0000
committerNick Mathewson <nickm@torproject.org>2006-09-19 22:20:09 +0000
commit7b0ec744bc8afa691873f97cfb6a3b7822376d7b (patch)
tree36879b2af44a9c2aabc7906816493d2a6993c692 /src/or/routerlist.c
parente9abe750ea68099e73064a84dab1e17bbb606c03 (diff)
downloadtor-7b0ec744bc8afa691873f97cfb6a3b7822376d7b.tar
tor-7b0ec744bc8afa691873f97cfb6a3b7822376d7b.tar.gz
Switch routerlist.c to using memcmp on digests rather than crypto_pk_cmp_keys(); speed up find_whitespace a lot (8x for me) by using a switch statement. This should speed parsing a lot of routers at once by a lot.
svn:r8430
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 4bc26b13a..1d067667b 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1674,7 +1674,8 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
routerinfo_t *old_router = smartlist_get(routerlist->routers, i);
/* XXXX This might be a slow point; can't we just look up in one of the
* digestmaps? -NM */
- if (!crypto_pk_cmp_keys(router->identity_pkey,old_router->identity_pkey)) {
+ if (!memcmp(router->cache_info.identity_digest,
+ old_router->cache_info.identity_digest, DIGEST_LEN)) {
if (router->cache_info.published_on <=
old_router->cache_info.published_on) {
/* Same key, but old */