Issue 488
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 2 Aug 2010 10:57:11 +0000 (10:57 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 2 Aug 2010 10:57:11 +0000 (10:57 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@1503 59b500cc-1b3d-0410-9834-0bbf25fbcc57

cpp/core/src/zxing/qrcode/detector/FinderPatternFinder.cpp

index 8b46b0f..7dbd334 100644 (file)
@@ -39,17 +39,17 @@ public:
   ClosestToAverageComparator(float averageModuleSize) :
       averageModuleSize_(averageModuleSize) {
   }
-  int operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) {
+  bool operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) {
     float dA = abs(a->getEstimatedModuleSize() - averageModuleSize_);
     float dB = abs(b->getEstimatedModuleSize() - averageModuleSize_);
-    return dA < dB ? -1 : dA > dB ? 1 : 0;
+    return dA < dB;
   }
 };
 
 class CenterComparator {
 public:
-  int operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) {
-    return b->getCount() - a->getCount();
+  bool operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) {
+    return a->getCount() < b->getCount();
   }
 };