diff --git a/folly/algorithm/simd/test/ContainsTest.cpp b/folly/algorithm/simd/test/ContainsTest.cpp index d140677ddd9..744f4d8beb9 100644 --- a/folly/algorithm/simd/test/ContainsTest.cpp +++ b/folly/algorithm/simd/test/ContainsTest.cpp @@ -138,8 +138,8 @@ TYPED_TEST(ContainsTest, Basic) { for (std::size_t size = 0; size != 100; ++size) { std::vector buf(size, T{0}); - for (std::size_t offset = 0; offset != std::min(32UL, buf.size()); - ++offset) { + auto const bound = std::min(std::size_t(32), size); + for (std::size_t offset = 0; offset != bound; ++offset) { folly::span haystack(buf.data() + offset, buf.data() + buf.size()); T needle{1}; testSimdContainsVerify(haystack, needle, /*expected*/ false);