[Groonga-commit] groonga/groonga at a6d046b [master] plugin string: avoid empty "for" body

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Feb 1 10:48:02 JST 2016


Kouhei Sutou	2016-02-01 10:48:02 +0900 (Mon, 01 Feb 2016)

  New Revision: a6d046b9b7247926ed50c38a19659334f09223d9
  https://github.com/groonga/groonga/commit/a6d046b9b7247926ed50c38a19659334f09223d9

  Message:
    plugin string: avoid empty "for" body

  Modified files:
    plugins/functions/string.c

  Modified: plugins/functions/string.c (+3 -1)
===================================================================
--- plugins/functions/string.c    2016-02-01 10:46:55 +0900 (00448f5)
+++ plugins/functions/string.c    2016-02-01 10:48:02 +0900 (cb2ee4b)
@@ -60,7 +60,9 @@ func_string_length(grn_ctx *ctx, int n_args, grn_obj **args,
     const char *e = GRN_TEXT_VALUE(target) + GRN_TEXT_LEN(target);
     const char *p;
     unsigned int cl = 0;
-    for (p = s; p < e && (cl = grn_charlen(ctx, p, e)); p += cl, length++);
+    for (p = s; p < e && (cl = grn_charlen(ctx, p, e)); p += cl) {
+      length++;
+    }
   }
 
   grn_length = grn_plugin_proc_alloc(ctx, user_data, GRN_DB_UINT32, 0);
-------------- next part --------------
HTML����������������������������...
Download 



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