]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make find_opt_by_keyword() take a const smartlist
authorDavid Goulet <dgoulet@torproject.org>
Tue, 1 May 2018 15:33:40 +0000 (11:33 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 1 May 2018 15:45:34 +0000 (11:45 -0400)
Part of #25988

Signed-off-by: David Goulet <dgoulet@torproject.org>
src/or/parsecommon.c
src/or/parsecommon.h

index 6c3dd3100ec76770b529298ef8dd2291c4405bf0..9bd00e17ce5762c42eb5a1f39d4d8d2e2d18752a 100644 (file)
@@ -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;
index 903d94478bd7c060f9d5da2efcf3884471521413..d33faf8ec75e25cfcbc2fc6e28c79be2f2f91c0b 100644 (file)
@@ -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);