[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Thu Nov 17 01:11:30 CET 2005


SVN commit 480903 by staikos:

please don't push all variable declarations to the top of the function.  That's an old C-ism and the result in Kst time and time again is that we have:
- computations that are done but no longer used and not removed since they're
 so detached from their meaningful areas
- unused variables lying around



 M  +2 -4      kstviewobject.cpp  


--- trunk/extragear/graphics/kst/kst/kstviewobject.cpp #480902:480903
@@ -605,8 +605,6 @@
 
 void KstViewObject::cleanup(int cols) {
   KstViewObjectList childrenCopy;
-  int rows;
-  int cnt;
     
   for (KstViewObjectList::ConstIterator i = _children.begin(); i != _children.end(); ++i) {
     if ((*i)->followsFlow()) {
@@ -614,7 +612,7 @@
     }
   }
   
-  cnt = childrenCopy.count();
+  int cnt = childrenCopy.count();
   if (cnt < 1) {
     return;
   }
@@ -634,7 +632,7 @@
       _columns = QMAX(1, int(sqrt(cnt)));
     }
   }  
-  rows = ( cnt + _columns - 1 ) / _columns;
+  int rows = ( cnt + _columns - 1 ) / _columns;
 
   double minDistance = 0.0;
   int pos = 0;


More information about the Kst mailing list