[Groonga-commit] groonga/groonga at 180099c [master] grn_ii_buffer: define variables at the beginning of a block

Back to archive index

susumu.yata null+****@clear*****
Fri Aug 14 14:24:40 JST 2015


susumu.yata	2015-08-14 14:24:40 +0900 (Fri, 14 Aug 2015)

  New Revision: 180099c5ef3b861fdead360c14c929514e6fe9c6
  https://github.com/groonga/groonga/commit/180099c5ef3b861fdead360c14c929514e6fe9c6

  Message:
    grn_ii_buffer: define variables at the beginning of a block

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+3 -2)
===================================================================
--- lib/ii.c    2015-08-14 14:20:15 +0900 (6fc796e)
+++ lib/ii.c    2015-08-14 14:24:40 +0900 (8e6e070)
@@ -7962,11 +7962,12 @@ ii_buffer_values_append(grn_ctx *ctx, grn_ii_buffer *ii_buffer,
   // TODO: Make a copy of a given value if need_copy == GRN_TRUE.
   if (ii_buffer->nvalues == ii_buffer->max_nvalues) {
     unsigned new_max_nvalues = ii_buffer->max_nvalues * 2;
+    unsigned new_size;
+    ii_buffer_value *new_values;
     if (new_max_nvalues == 0) {
       new_max_nvalues = 1;
     }
-    unsigned new_size = new_max_nvalues * sizeof(ii_buffer_value);
-    ii_buffer_value *new_values;
+    new_size = new_max_nvalues * sizeof(ii_buffer_value);
     new_values = (ii_buffer_value *)GRN_REALLOC(ii_buffer->values, new_size);
     if (!new_values) {
       return;
-------------- next part --------------
HTML����������������������������...
Download 



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