diff options
| -rw-r--r-- | csgterm.cc | 6 | ||||
| -rw-r--r-- | mainwin.cc | 9 | 
2 files changed, 9 insertions, 6 deletions
| @@ -69,11 +69,13 @@ CSGTerm *CSGTerm::normalize()  		y->unlink();  	} -	do { +	while (1) {  		t2 = t1->normalize_tail();  		t1->unlink(); +		if (t1 == t2) +			break;  		t1 = t2; -	} while (t1 != t2); +	}  	return t1;  } @@ -265,12 +265,13 @@ void MainWindow::actionCompile()  	root_norm_term = root_raw_term->link(); -	CSGTerm *n; -	do { -		n = root_norm_term->normalize(); +	while (1) { +		CSGTerm *n = root_norm_term->normalize();  		root_norm_term->unlink(); +		if (root_norm_term == n) +			break;  		root_norm_term = n; -	} while (root_norm_term != n); +	}  	if (!root_norm_term) {  		console->append("Compilation failed!"); | 
