[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] refactoring on ha_groonga::rnd_next.

Back to archive index

Tetsuro IKEDA null+****@clear*****
Thu Oct 4 10:19:34 JST 2012


Tetsuro IKEDA	2009-07-29 17:31:29 +0900 (Wed, 29 Jul 2009)

  New Revision: ba4ea9eae4400d344724aaf5e7167a71dea58c40
  https://github.com/mroonga/mroonga/commit/ba4ea9eae4400d344724aaf5e7167a71dea58c40

  Log:
    refactoring on ha_groonga::rnd_next.

  Modified files:
    ha_groonga.cc

  Modified: ha_groonga.cc (+10 -11)
===================================================================
--- ha_groonga.cc    2009-07-29 17:08:04 +0900 (9314476)
+++ ha_groonga.cc    2009-07-29 17:31:29 +0900 (8ddbb46)
@@ -522,32 +522,31 @@ int ha_groonga::rnd_next(uchar *buf)
   }
   if (rc == 0)
   {
-    Field **field;
-    int i,j;
-    for (i=0,j=0, field = table->field; *field; i++, field++)
+    Field **field = table->field;
+    mrn_column_info **column = cond->list->columns;
+    grn_obj *value;
+    int i;
+    for (i=0; *field; field++, column++)
     {
-      if ((cond) && (cond->list->columns[i] == NULL))
+      if ((cond) && (*column == NULL))
       {
         (*field)->set_null();
       }
       else
       {
-        int vint;
-        char *vchar;
+        value = record->value[i];
         switch ((*field)->type())
         {
         case (MYSQL_TYPE_LONG) :
-          vint = GRN_INT32_VALUE(record->value[j]);
           (*field)->set_notnull();
-          (*field)->store(vint);
+          (*field)->store(GRN_INT32_VALUE(value));
           break;
         case (MYSQL_TYPE_VARCHAR) :
-          vchar = GRN_TEXT_VALUE(record->value[j]);
           (*field)->set_notnull();
-          (*field)->store(vchar, GRN_BULK_WSIZE(record->value[j]), (*field)->charset());
+          (*field)->store(GRN_TEXT_VALUE(value), GRN_BULK_WSIZE(value), (*field)->charset());
           break;
         }
-        j++;
+        i++;
       }
     }
     mrn_rewind_record(ctx, record);
-------------- next part --------------
HTML����������������������������...
Download 



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