diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-02-20 01:08:12 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-02-20 01:08:12 -0500 |
commit | 8a9d86bf05110426e05c5dde4b22e45dfa99f8e9 (patch) | |
tree | 89a61fdc3ea13d597b9f913e8b28af1a261bf7d9 /src/common/container.h | |
parent | 03a4e97c76b2021ec7246da03fb31d337fb50f9b (diff) | |
parent | 69df16e3765383bd59fd2fbedbb5301f3b58ab14 (diff) | |
download | tor-8a9d86bf05110426e05c5dde4b22e45dfa99f8e9.tar.gz tor-8a9d86bf05110426e05c5dde4b22e45dfa99f8e9.zip |
Merge remote-tracking branch 'public/bug11454_11457'
Diffstat (limited to 'src/common/container.h')
-rw-r--r-- | src/common/container.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/container.h b/src/common/container.h index 6edc80f75b..d07697f019 100644 --- a/src/common/container.h +++ b/src/common/container.h @@ -247,6 +247,17 @@ char *smartlist_join_strings2(smartlist_t *sl, const char *join, STMT_END /** Helper: While in a SMARTLIST_FOREACH loop over the list <b>sl</b> indexed + * with the variable <b>var</b>, remove the current element in a way that + * won't confuse the loop. */ +#define SMARTLIST_DEL_CURRENT_KEEPORDER(sl, var) \ + STMT_BEGIN \ + smartlist_del_keeporder(sl, var ## _sl_idx); \ + --var ## _sl_idx; \ + --var ## _sl_len; \ + STMT_END + + +/** Helper: While in a SMARTLIST_FOREACH loop over the list <b>sl</b> indexed * with the variable <b>var</b>, replace the current element with <b>val</b>. * Does not deallocate the current value of <b>var</b>. */ |