From e5baaa965b0f902102da67cf5c6d28efeddd81ef Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Sun, 14 Oct 2012 01:39:24 +0400 Subject: [PATCH] Make sure there is no signed int overflow Summary: use proper type for index. Test Plan: . Reviewed By: tudorb@fb.com FB internal diff: D660142 --- folly/small_vector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/folly/small_vector.h b/folly/small_vector.h index cf9caa6e..45697b86 100644 --- a/folly/small_vector.h +++ b/folly/small_vector.h @@ -205,7 +205,7 @@ namespace detail { void populateMemForward(T* mem, std::size_t n, Function const& op) { std::size_t idx = 0; try { - for (int i = 0; i < n; ++i) { + for (size_t i = 0; i < n; ++i) { op(&mem[idx]); ++idx; } -- 2.34.1