[QGIS Commit] r8142 - trunk/qgis/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Feb 12 13:12:26 EST 2008


Author: timlinux
Date: 2008-02-12 13:12:26 -0500 (Tue, 12 Feb 2008)
New Revision: 8142

Modified:
   trunk/qgis/src/core/qgspoint.cpp
   trunk/qgis/src/core/qgspoint.h
Log:
Use qMax macro instead of reimplementing the same thing


Modified: trunk/qgis/src/core/qgspoint.cpp
===================================================================
--- trunk/qgis/src/core/qgspoint.cpp	2008-02-12 16:44:14 UTC (rev 8141)
+++ trunk/qgis/src/core/qgspoint.cpp	2008-02-12 18:12:26 UTC (rev 8142)
@@ -99,7 +99,7 @@
   //algorithm from 'graphics GEMS', A. Paeth: 'A Fast 2D Point-on-line test'
   if(
      fabs( (b.y() - a.y()) * (m_x - a.x()) - (m_y - a.y()) * (b.x() - a.x())) \
-     >= maxValue( fabs(b.x() - a.x()), fabs(b.y() - a.y()))
+     >= qMax( fabs(b.x() - a.x()), fabs(b.y() - a.y()))
      )
     {
       return 0;
@@ -123,15 +123,3 @@
 
   return 2;
 }
-
-double QgsPoint::maxValue(double a, double b) const
-{
-  if(b > a)
-    {
-      return b;
-    }
-  else
-    {
-      return a;
-    }
-}

Modified: trunk/qgis/src/core/qgspoint.h
===================================================================
--- trunk/qgis/src/core/qgspoint.h	2008-02-12 16:44:14 UTC (rev 8141)
+++ trunk/qgis/src/core/qgspoint.h	2008-02-12 18:12:26 UTC (rev 8142)
@@ -127,9 +127,6 @@
     //! y coordinate 
     double m_y;
 
-    //! little helper function that returns the maximum of 
-    //! two doubles (or a in case of equality)
-    double maxValue(double a, double b) const;
     
 }; // class QgsPOint
 



More information about the QGIS-commit mailing list