[Groonga-commit] groonga/groonga at d6c8ed1 [master] Avoid to divide by zero

Back to archive index

Naoya Murakami null+****@clear*****
Fri May 20 16:06:12 JST 2016


Naoya Murakami	2016-04-27 13:33:02 +0900 (Wed, 27 Apr 2016)

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

  Merged 429e423: Merge pull request #533 from naoa/overlap-token-skip

  Message:
    Avoid to divide by zero

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+3 -1)
===================================================================
--- lib/ii.c    2016-04-23 14:12:44 +0900 (ef8c66b)
+++ lib/ii.c    2016-04-27 13:33:02 +0900 (5f1808f)
@@ -6074,7 +6074,9 @@ token_candidate_score(grn_ctx *ctx, token_candidate_node *nodes, uint32_t candid
   for (i = 0; i <= last; i++) {
     if (candidate & (1 << i)) {
       token_candidate_node *node = nodes + i + offset;
-      score += max_estimated_size / node->estimated_size;
+      if (node->estimated_size > 0) {
+        score += max_estimated_size / node->estimated_size;
+      }
     }
   }
   return score;
-------------- next part --------------
HTML����������������������������...
下载 



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