[Groonga-commit] groonga/grnxx at 462fccc [master] Update ReverseComparer to use RegularComparer.

アーカイブの一覧に戻る

susumu.yata null+****@clear*****
Wed Jul 30 18:01:59 JST 2014


susumu.yata	2014-07-30 18:01:59 +0900 (Wed, 30 Jul 2014)

  New Revision: 462fccce95c5ef8b248051b06713515762ada5f1
  https://github.com/groonga/grnxx/commit/462fccce95c5ef8b248051b06713515762ada5f1

  Message:
    Update ReverseComparer to use RegularComparer.

  Modified files:
    lib/grnxx/sorter.cpp

  Modified: lib/grnxx/sorter.cpp (+3 -3)
===================================================================
--- lib/grnxx/sorter.cpp    2014-07-30 17:59:04 +0900 (fee7fac)
+++ lib/grnxx/sorter.cpp    2014-07-30 18:01:59 +0900 (2acc42a)
@@ -43,7 +43,7 @@ namespace {
 template <typename T>
 struct RegularComparer {
   using Value = T;
-  bool operator()(T lhs, T rhs) const {
+  bool operator()(Value lhs, Value rhs) const {
     return lhs < rhs;
   }
 };
@@ -51,8 +51,8 @@ struct RegularComparer {
 template <typename T>
 struct ReverseComparer {
   using Value = T;
-  bool operator()(T lhs, T rhs) const {
-    return rhs < lhs;
+  bool operator()(Value lhs, Value rhs) const {
+    return RegularComparer<T>()(rhs, lhs);
   }
 };
 
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る