[Groonga-commit] groonga/grnxx at 25568f0 [master] Update MapSetCursor for the new Cursor. (#61)

Back to archive index

susumu.yata null+****@clear*****
Thu Sep 18 16:10:48 JST 2014


susumu.yata	2014-09-18 16:10:48 +0900 (Thu, 18 Sep 2014)

  New Revision: 25568f0a81e14aeac9ff6061ad43d5bcb65f4fe6
  https://github.com/groonga/grnxx/commit/25568f0a81e14aeac9ff6061ad43d5bcb65f4fe6

  Message:
    Update MapSetCursor for the new Cursor. (#61)

  Modified files:
    lib/grnxx/index.cpp

  Modified: lib/grnxx/index.cpp (+4 -7)
===================================================================
--- lib/grnxx/index.cpp    2014-09-18 16:09:07 +0900 (039d1fa)
+++ lib/grnxx/index.cpp    2014-09-18 16:10:48 +0900 (2685882)
@@ -261,7 +261,7 @@ class MapSetCursor : public Cursor {
   }
   ~MapSetCursor() {}
 
-  Int read(Error *error, Int max_count, Array<Record> *records);
+  Int read(Error *error, ArrayRef<Record> records);
 
  private:
   MapIterator map_begin_;
@@ -277,9 +277,8 @@ class MapSetCursor : public Cursor {
 };
 
 template <typename T>
-Int MapSetCursor<T>::read(Error *error,
-                          Int max_count,
-                          Array<Record> *records) {
+Int MapSetCursor<T>::read(Error *, ArrayRef<Record> records) {
+  Int max_count = records.size();
   if (max_count > limit_left_) {
     max_count = limit_left_;
   }
@@ -303,9 +302,7 @@ Int MapSetCursor<T>::read(Error *error,
     if (offset_left_ > 0) {
       --offset_left_;
     } else {
-      if (!records->push_back(error, Record(*set_it_, 0.0))) {
-        return -1;
-      }
+      records.set(count, Record(*set_it_, 0.0));
       ++count;
     }
     ++set_it_;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index