Index: /issm/trunk/src/c/shared/Numerics/BrentSearch.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/BrentSearch.cpp	(revision 392)
+++ /issm/trunk/src/c/shared/Numerics/BrentSearch.cpp	(revision 393)
@@ -29,10 +29,10 @@
 
 	/*function values: */
-	double fxmax,fxmin,fxbest,fval;
+	double fxmax,fxmin,fxbest;
 	double fx,fx1,fx2;
 
 	/*x : */
 	double xmax,xmin,xbest;
-	double x,x1,x2,xm,xval;
+	double x,x1,x2,xm;
 
 	/*tolerances: */
@@ -233,19 +233,14 @@
 	//Now, check that the value on the boundaries are not better than current fxbest
 	if (fxbest>fxmin){
-		xval=xmin;
-		fval=fxmin;
+		xbest=xmin;
+		fxbest=fxmin;
 	}
-	else if (fxbest>fxmax){
-		xval=xmax;
-		fval=fxmax;
+	if (fxbest>fxmax){
+		xbest=xmax;
+		fxbest=fxmax;
 	}
-	else{
-		xval=xbest;
-		fval=fxbest;
-	}
 
 	/*Assign output pointers: */
-	*psearch_scalar=xval;
-	*pJ=fval;
-	
+	*psearch_scalar=xbest;
+	*pJ=fxbest;
 }
