[Groonga-commit] groonga/groonga at 90390ea [master] Don't use the same variable

Back to archive index
Kouhei Sutou null+****@clear*****
Sat Mar 23 07:14:11 JST 2019


Kouhei Sutou	2019-03-23 07:14:11 +0900 (Sat, 23 Mar 2019)

  Revision: 90390ea038bb36d6b570f40071d976137ed6d09d
  https://github.com/groonga/groonga/commit/90390ea038bb36d6b570f40071d976137ed6d09d

  Message:
    Don't use the same variable

  Modified files:
    lib/index_column.c

  Modified: lib/index_column.c (+4 -4)
===================================================================
--- lib/index_column.c    2019-03-23 07:08:25 +0900 (899e29758)
+++ lib/index_column.c    2019-03-23 07:14:11 +0900 (a44ed2ec5)
@@ -830,9 +830,9 @@ grn_index_column_diff_compute(grn_ctx *ctx,
       case GRN_UVECTOR :
         if (is_reference) {
           const size_t n_elements = grn_uvector_size(ctx, value);
-          for (size_t i = 0; i < n_elements; i++) {
+          for (size_t j = 0; j < n_elements; j++) {
             const grn_id element =
-              grn_uvector_get_element(ctx, value, i, NULL);
+              grn_uvector_get_element(ctx, value, j, NULL);
             data->current.token_id = element;
             data->current.posting.pos = 0;
             grn_index_column_diff_process_token_id(ctx, data);
@@ -840,8 +840,8 @@ grn_index_column_diff_compute(grn_ctx *ctx,
         } else {
           const size_t n_elements = grn_uvector_size(ctx, value);
           const size_t element_size = grn_uvector_element_size(ctx, value);
-          for (size_t i = 0; i < n_elements; i++) {
-            const char *element = GRN_BULK_HEAD(value) + (element_size * i);
+          for (size_t j = 0; j < n_elements; j++) {
+            const char *element = GRN_BULK_HEAD(value) + (element_size * j);
             data->current.token_id =
               grn_table_get(ctx, data->lexicon, element, element_size);
             if (data->current.token_id == GRN_ID_NIL) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190323/bff727a6/attachment-0001.html>


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