[Groonga-commit] groonga/groonga at 1a948c3 [master] io: reduce scope

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Jan 17 17:21:19 JST 2015


Kouhei Sutou	2015-01-17 17:21:19 +0900 (Sat, 17 Jan 2015)

  New Revision: 1a948c39867c6984d5ac6e320dce47c74302d896
  https://github.com/groonga/groonga/commit/1a948c39867c6984d5ac6e320dce47c74302d896

  Message:
    io: reduce scope

  Modified files:
    lib/io.c

  Modified: lib/io.c (+5 -3)
===================================================================
--- lib/io.c    2015-01-17 16:17:46 +0900 (a5e57dd)
+++ lib/io.c    2015-01-17 17:21:19 +0900 (64b1dda)
@@ -1135,11 +1135,13 @@ grn_io_expire(grn_ctx *ctx, grn_io *io, int count_thresh, uint32_t limit)
       uint32_t nref, nmaps, *pnref = &io->nref;
       GRN_ATOMIC_ADD_EX(pnref, 1, nref);
       if (!nref && grn_gtick - io->count > count_thresh) {
-        uint32_t i = io->header->n_arrays;
         grn_io_mapinfo *info = io->maps;
         grn_io_array_spec *array_specs = (grn_io_array_spec *)io->user_header;
-        while (i--) {
-          memset(io->ainfo[i].addrs, 0, sizeof(void *) * array_specs[i].max_n_segments);
+        {
+          uint32_t i = io->header->n_arrays;
+          while (i--) {
+            memset(io->ainfo[i].addrs, 0, sizeof(void *) * array_specs[i].max_n_segments);
+          }
         }
         for (m = io->max_map_seg; m; info++, m--) {
           if (info->map) {
-------------- next part --------------
HTML����������������������������...
Download 



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