Fix vector bug

This commit is contained in:
topjohnwu 2017-04-07 07:29:29 +08:00
parent b94227efc9
commit a1fd7704e0

View File

@ -26,6 +26,6 @@ void vec_deep_destroy(struct vector *v);
#define vec_for_each_r(v, e) \ #define vec_for_each_r(v, e) \
e = (v)->data[(v)->size - 1]; \ e = (v)->data[(v)->size - 1]; \
for (size_t _ = (v)->size - 1; _ >= 0; --_, e = (v)->data[_]) for (size_t _ = (v)->size; _ > 0; --_, e = (v)->data[_ - 1])
#endif #endif