summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2018-05-01 11:33:40 -0400
committerDavid Goulet <dgoulet@torproject.org>2018-05-01 11:45:34 -0400
commit5db331e8fccd1bf365b8e300f940eb1dd85072f9 (patch)
treea85cb319fee28636bcabff7d02f55a3c0007460a
parent70c92c336661a164e3905be157aa8a16de77462a (diff)
downloadtor-5db331e8fccd1bf365b8e300f940eb1dd85072f9.tar.gz
tor-5db331e8fccd1bf365b8e300f940eb1dd85072f9.zip
Make find_opt_by_keyword() take a const smartlist
Part of #25988 Signed-off-by: David Goulet <dgoulet@torproject.org>
-rw-r--r--src/or/parsecommon.c2
-rw-r--r--src/or/parsecommon.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/or/parsecommon.c b/src/or/parsecommon.c
index 6c3dd3100e..9bd00e17ce 100644
--- a/src/or/parsecommon.c
+++ b/src/or/parsecommon.c
@@ -426,7 +426,7 @@ find_by_keyword_(smartlist_t *s, directory_keyword keyword,
* NULL if no such keyword is found.
*/
directory_token_t *
-find_opt_by_keyword(smartlist_t *s, directory_keyword keyword)
+find_opt_by_keyword(const smartlist_t *s, directory_keyword keyword)
{
SMARTLIST_FOREACH(s, directory_token_t *, t, if (t->tp == keyword) return t);
return NULL;
diff --git a/src/or/parsecommon.h b/src/or/parsecommon.h
index 903d94478b..d33faf8ec7 100644
--- a/src/or/parsecommon.h
+++ b/src/or/parsecommon.h
@@ -314,7 +314,7 @@ directory_token_t *find_by_keyword_(smartlist_t *s,
#define find_by_keyword(s, keyword) \
find_by_keyword_((s), (keyword), #keyword)
-directory_token_t *find_opt_by_keyword(smartlist_t *s,
+directory_token_t *find_opt_by_keyword(const smartlist_t *s,
directory_keyword keyword);
smartlist_t * find_all_by_keyword(const smartlist_t *s, directory_keyword k);