Navigation Menu

Skip to content

Commit

Permalink
Use incremental style loop
Browse files Browse the repository at this point in the history
It's for easy to debug.
  • Loading branch information
kou committed Jan 17, 2015
1 parent 38eb336 commit 388e936
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/io.c
Expand Up @@ -537,7 +537,6 @@ grn_rc
grn_io_close(grn_ctx *ctx, grn_io *io)
{
int i;
grn_io_mapinfo *mi;
fileinfo *fi;
uint32_t max_nfiles;

Expand Down Expand Up @@ -569,7 +568,11 @@ grn_io_close(grn_ctx *ctx, grn_io *io)
#endif /* WIN32 */
GRN_MUNMAP(&grn_gctx, &io->fis->fmo, io->header, io->base);
if (io->fis) {
for (fi = io->fis, i = max_nfiles; i; fi++, i--) { grn_close(ctx, fi); }
int i;
for (i = 0; i < max_nfiles; i++) {
fileinfo *fi = &(io->fis[i]);
grn_close(ctx, fi);
}
GRN_GFREE(io->fis);
}
GRN_GFREE(io);
Expand Down

0 comments on commit 388e936

Please sign in to comment.