summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-02-20 01:08:12 -0500
committerNick Mathewson <nickm@torproject.org>2015-02-20 01:08:12 -0500
commit8a9d86bf05110426e05c5dde4b22e45dfa99f8e9 (patch)
tree89a61fdc3ea13d597b9f913e8b28af1a261bf7d9 /src/common
parent03a4e97c76b2021ec7246da03fb31d337fb50f9b (diff)
parent69df16e3765383bd59fd2fbedbb5301f3b58ab14 (diff)
downloadtor-8a9d86bf05110426e05c5dde4b22e45dfa99f8e9.tar.gz
tor-8a9d86bf05110426e05c5dde4b22e45dfa99f8e9.zip
Merge remote-tracking branch 'public/bug11454_11457'
Diffstat (limited to 'src/common')
-rw-r--r--src/common/container.h11
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>.
*/