From 2e11cfcd42f11cd1eff7d17ab68d69fc2d71e9d7 Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Sun, 20 Jan 2002 17:46:01 +0000 Subject: [PATCH] Refactored the test not to use an O(N*N) operation. Repetition count remains the same. [SVN r12374] --- test/for_test.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/for_test.cpp b/test/for_test.cpp index 6772f7d..4cc81d1 100644 --- a/test/for_test.cpp +++ b/test/for_test.cpp @@ -10,8 +10,7 @@ // See http://www.boost.org for most recent version. #include -#include -#include +#include #include @@ -21,8 +20,8 @@ #define FOR_TEST_MAX 50 #endif -#define C(D,X) BOOST_PP_LESS_EQUAL(X,FOR_TEST_MAX) -#define F(D,X) BOOST_PP_INC(X) +#define C(D,X) X +#define F(D,X) BOOST_PP_DEC(X) #define I(D,X) -X -TEST((FOR_TEST_MAX*(FOR_TEST_MAX+1)/2)+1 BOOST_PP_FOR(0,C,F,I)) +TEST((FOR_TEST_MAX*(FOR_TEST_MAX+1)/2)+1 BOOST_PP_FOR(FOR_TEST_MAX,C,F,I))