aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vppinfra/vec_bootstrap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vppinfra/vec_bootstrap.h b/src/vppinfra/vec_bootstrap.h
index 6db83f23f72..bff688965b4 100644
--- a/src/vppinfra/vec_bootstrap.h
+++ b/src/vppinfra/vec_bootstrap.h
@@ -191,6 +191,10 @@ for (var = vec_end (vec) - 1; var >= (vec); var--)
/** \brief Iterate over vector indices. */
#define vec_foreach_index(var,v) for ((var) = 0; (var) < vec_len (v); (var)++)
+/** \brief Iterate over vector indices (reverse). */
+#define vec_foreach_index_backwards(var,v) \
+ for ((var) = vec_len((v)) - 1; (var) >= 0; (var)--)
+
#endif /* included_clib_vec_bootstrap_h */
/*