lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [6015] Refactor for concinnity


From: Greg Chicares
Subject: [lmi-commits] [6015] Refactor for concinnity
Date: Sat, 01 Nov 2014 20:23:13 +0000

Revision: 6015
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6015
Author:   chicares
Date:     2014-11-01 20:23:11 +0000 (Sat, 01 Nov 2014)
Log Message:
-----------
Refactor for concinnity

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/census_view.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2014-11-01 17:37:43 UTC (rev 6014)
+++ lmi/trunk/ChangeLog 2014-11-01 20:23:11 UTC (rev 6015)
@@ -34499,3 +34499,8 @@
   census_view.cpp
 Show busy cursor and timings for some potentially-costly operations.
 
+20141101T2023Z <address@hidden> [522]
+
+  census_view.cpp
+Refactor for concinnity.
+

Modified: lmi/trunk/census_view.cpp
===================================================================
--- lmi/trunk/census_view.cpp   2014-11-01 17:37:43 UTC (rev 6014)
+++ lmi/trunk/census_view.cpp   2014-11-01 20:23:11 UTC (rev 6015)
@@ -934,8 +934,8 @@
     ,std::vector<Input> const& cells
     ) const
 {
-    std::vector<Input>::const_iterator j;
-    for(j = cells.begin(); j != cells.end(); ++j)
+    typedef std::vector<Input>::const_iterator ici;
+    for(ici j = cells.begin(); j != cells.end(); ++j)
         {
         if(!((*j)[header] == case_parms()[0][header]))
             {
@@ -1004,11 +1004,8 @@
     // Extract names and add them even if they might be duplicates.
     std::vector<std::string> all_class_names;
 
-    for
-        (std::vector<Input>::iterator i = cell_parms().begin()
-        ;i != cell_parms().end()
-        ;++i
-        )
+    typedef std::vector<Input>::const_iterator ici;
+    for(ici i = cell_parms().begin(); i != cell_parms().end(); ++i)
         {
         all_class_names.push_back((*i)["EmployeeClass"].str());
         }
@@ -1101,52 +1098,32 @@
 
     std::vector<std::string> headers_of_changed_parameters;
     std::vector<std::string> const& 
all_headers(case_parms()[0].member_names());
-    std::vector<std::string>::const_iterator i;
-    for
-        (i  = all_headers.begin()
-        ;i != all_headers.end  ()
-        ;++i
-        )
+    typedef std::vector<std::string>::const_iterator sci;
+    for(sci i = all_headers.begin(); i != all_headers.end(); ++i)
         {
         if(!(old_parms[*i] == new_parms[*i]))
             {
             headers_of_changed_parameters.push_back(*i);
             }
         }
-    for
-        (i  = headers_of_changed_parameters.begin()
-        ;i != headers_of_changed_parameters.end  ()
-        ;++i
-        )
+    for(sci i = headers_of_changed_parameters.begin(); i != 
headers_of_changed_parameters.end(); ++i)
         {
         if(!for_this_class_only)
             {
-            std::vector<Input>::iterator j;
-            for
-                (j  = class_parms().begin()
-                ;j != class_parms().end  ()
-                ;++j
-                )
+            typedef std::vector<Input>::iterator ii;
+            for(ii j = class_parms().begin(); j != class_parms().end(); ++j)
                 {
                 (*j)[*i] = new_parms[*i].str();
                 }
-            for
-                (j  = cell_parms().begin()
-                ;j != cell_parms().end  ()
-                ;++j
-                )
+            for(ii j = cell_parms ().begin(); j != cell_parms ().end(); ++j)
                 {
                 (*j)[*i] = new_parms[*i].str();
                 }
             }
         else
             {
-            std::vector<Input>::iterator j;
-            for
-                (j  = cell_parms().begin()
-                ;j != cell_parms().end  ()
-                ;++j
-                )
+            typedef std::vector<Input>::iterator ii;
+            for(ii j = cell_parms().begin(); j != cell_parms().end(); ++j)
                 {
                 if((*j)["EmployeeClass"] == old_parms["EmployeeClass"])
                     {
@@ -1164,12 +1141,12 @@
     // discipline isn't sufficiently strict. For now, applying the
     // present technique elsewhere might well exacerbate crosstalk
     // in a census that comprises more than one product.
-    std::vector<Input>::iterator j;
-    for(j = class_parms().begin(); j != class_parms().end(); ++j)
+    typedef std::vector<Input>::iterator ii;
+    for(ii j = class_parms().begin(); j != class_parms().end(); ++j)
         {
         j->Reconcile();
         }
-    for(j = cell_parms() .begin(); j != cell_parms() .end(); ++j)
+    for(ii j = cell_parms() .begin(); j != cell_parms() .end(); ++j)
         {
         j->Reconcile();
         }
@@ -1547,7 +1524,9 @@
     // accordingly.
     list_model_->RowsDeleted(erasures);
     for(unsigned int j = erasures.front(); j < cell_parms().size(); ++j)
+        {
         list_model_->RowValueChanged(j, CensusViewDataViewModel::Col_CellNum);
+        }
 
     unsigned int const newsel = std::min
         (static_cast<std::size_t>(erasures.front())




reply via email to

[Prev in Thread] Current Thread [Next in Thread]