From 971c078783311d30d96f539908f2e00de79500e6 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Wed, 22 Sep 2010 14:30:00 +0000
Subject: [PATCH] faster min/max

---
 Fltk/optionWindow.cpp | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/Fltk/optionWindow.cpp b/Fltk/optionWindow.cpp
index 9bd6d0e7f8..951cff68a1 100644
--- a/Fltk/optionWindow.cpp
+++ b/Fltk/optionWindow.cpp
@@ -549,18 +549,17 @@ static void view_options_ok_cb(Fl_Widget *w, void *data)
   if(data){
     const char *str = (const char*)data;
     if(!strcmp(str, "range_min") || !strcmp(str, "range_max")){
-      double vmin = 0., vmax = 0.;
       int vindex = o->view.index;
       if(vindex >= 0 && vindex < (int)PView::list.size()){
         // compute min/max taking current visibility status into account
         int step = opt_view_timestep(vindex, GMSH_GET, 0);
-        vmin = PView::list[vindex]->getData(true)->getMin(step, true);
-        vmax = PView::list[vindex]->getData(true)->getMax(step, true);
+        if(!strcmp(str, "range_min"))
+          o->view.value[31]->value
+            (PView::list[vindex]->getData(true)->getMin(step, true));
+        else if(!strcmp(str, "range_max"))
+          o->view.value[32]->value
+            (PView::list[vindex]->getData(true)->getMax(step, true));
       }
-      if(!strcmp(str, "range_min"))
-        o->view.value[31]->value(vmin);
-      else if(!strcmp(str, "range_max"))
-        o->view.value[32]->value(vmax);
     }
   }
   
-- 
GitLab