From 10a5d62de08035803b5fadc5fcd32c873f8b1702 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 17 Nov 2008 04:45:41 +0000 Subject: Convert for-if-break construct into do while git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@77 0d43b9a7-5ab2-4d7b-af9d-f64450cef757 --- neural.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/neural.c b/neural.c index 996d5cd..05e7c2b 100644 --- a/neural.c +++ b/neural.c @@ -120,7 +120,7 @@ DoNNET(void) clock_t total_time = 0; int iterations = 0; static bool is_adjusted = false; - static int loops = 1; + static int loops = 0; /* ** Init random number generator. @@ -151,12 +151,10 @@ DoNNET(void) ** # of loops and increasing the loop count until we ** get a number of loops that we can use. */ - for (; loops < LOOP_MAX; loops++) { - randnum((int32_t)3); - if(DoNNetIteration(loops) > MINIMUM_TICKS) { - break; - } - } + do { + randnum(3); + ++loops; + } while ((DoNNetIteration(loops) <= MINIMUM_TICKS) && (loops < LOOP_MAX)); } do { -- cgit v1.2.3