[Groonga-commit] groonga/groonga at 071c068 [master] Don't use negative condition and "else"

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jun 5 16:30:45 JST 2017


Kouhei Sutou	2017-06-05 16:30:45 +0900 (Mon, 05 Jun 2017)

  New Revision: 071c068855f32c1513d99e65b5d81040f8df4781
  https://github.com/groonga/groonga/commit/071c068855f32c1513d99e65b5d81040f8df4781

  Message:
    Don't use negative condition and "else"
    
    It's confused.

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+4 -4)
===================================================================
--- lib/ii.c    2017-06-05 16:29:27 +0900 (3e42996)
+++ lib/ii.c    2017-06-05 16:30:45 +0900 (79f0fb5)
@@ -10295,12 +10295,12 @@ grn_ii_buffer_commit(grn_ctx *ctx, grn_ii_buffer *ii_buffer)
           "tmpfile_size:%" GRN_FMT_INT64D " > total_chunk_size:%" GRN_FMT_SIZE,
           ii_buffer->filepos, ii_buffer->total_chunk_size);
   grn_close(ii_buffer->tmpfd);
-  if (grn_unlink(ii_buffer->tmpfpath) != 0) {
-    ERRNO_ERR("failed to remove path on grn_ii_buffer_commit(): <%s>",
-              ii_buffer->tmpfpath);
-  } else {
+  if (grn_unlink(ii_buffer->tmpfpath) == 0) {
     GRN_LOG(ctx, GRN_LOG_INFO,
             "removed path on grn_ii_buffer_commit(): <%s>", ii_buffer->tmpfpath);
+  } else {
+    ERRNO_ERR("failed to remove path on grn_ii_buffer_commit(): <%s>",
+              ii_buffer->tmpfpath);
   }
   ii_buffer->tmpfd = -1;
   return ctx->rc;
-------------- next part --------------
HTML����������������������������...
Download 



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