<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <dl style="line-height: 1.5; margin-left: 2em">
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Author</dt>
      <dd style="margin-left: 8.5em">Kouhei Sutou &lt;kou****@clear*****&gt;</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
      <dd style="margin-left: 8.5em">2015-10-09 21:33:51 +0900 (Fri, 09 Oct 2015)</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">New Revision</dt>
      <dd style="margin-left: 8.5em"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d">b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d</a></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Message</dt>
      <dd style="margin-left: 8.5em"><pre style="border: 1px solid #aaa; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; padding: 0.5em; width: auto">pat: fix unexpected count up</pre></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Modified files</dt>
      <dd style="margin-left: 8.5em">
        <ul>
          <li><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265f">lib/pat.c</a></li>
        </ul>
      </dd>
    </dl>

    <div class="diff-section" style="clear: both">
      <table style="border-collapse: collapse; border: 1px solid #aaa">
        <thead>
          <tr class="diff-header" style="border: 1px solid #aaa">
            <td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">  Modified: lib/pat.c (+5 -5)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
            </td>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL702">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL703">703</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL704">704</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL705">705</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL706">706</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL707">707</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL708">708</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL709">709</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL710">710</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL711">711</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL712">712</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL717">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL718">718</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL719">719</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL720">720</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL721">721</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL722">722</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL723">723</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL724">724</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL725">725</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL726">726</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL727">727</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL728">728</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fL729">729</a></span>
</pre>
            </th>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR702">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR703">703</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR704">704</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR705">705</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR706">706</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR707">707</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR708">708</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR709">709</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR710">710</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR711">711</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR712">712</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR717">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR718">718</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR719">719</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR720">720</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR721">721</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR722">722</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR723">723</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR724">724</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR725">725</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR726">726</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR727">727</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR728">728</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/b4a8e3975a6e4966ef8b03b7ba36fa92eb010e6d#diff-e8f58132837f95fac7913a81cae2265fR729">729</a></span>
</pre>
            </th>
            <td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -703,10 +703,10 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">_grn_pat_add(grn_ctx *ctx, grn_pat *pat, const uint8_t *key, uint32_t size, uint</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">     if (*lkey &amp;&amp; size2) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       if (pat-&gt;header-&gt;garbages[0]) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         r = pat-&gt;header-&gt;garbages[0];</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-        pat-&gt;header-&gt;n_entries++;</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-        pat-&gt;header-&gt;n_garbages--;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         PAT_AT(pat, r, rn);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         if (!rn) { return 0; }</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+        pat-&gt;header-&gt;n_entries++;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+        pat-&gt;header-&gt;n_garbages--;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         pat-&gt;header-&gt;garbages[0] = rn-&gt;lr[0];</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       } else {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         if (!(rn = pat_node_new(ctx, pat, &amp;r))) { return 0; }</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -718,12 +718,12 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">_grn_pat_add(grn_ctx *ctx, grn_pat *pat, const uint8_t *key, uint32_t size, uint</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">       if (pat-&gt;header-&gt;garbages[size2]) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         uint8_t *keybuf;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         r = pat-&gt;header-&gt;garbages[size2];</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-        pat-&gt;header-&gt;n_entries++;</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-        pat-&gt;header-&gt;n_garbages--;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         PAT_AT(pat, r, rn);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         if (!rn) { return 0; }</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-        pat-&gt;header-&gt;garbages[size2] = rn-&gt;lr[0];</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         if (!(keybuf = pat_node_get_key(ctx, pat, rn))) { return 0; }</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+        pat-&gt;header-&gt;n_entries++;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+        pat-&gt;header-&gt;n_garbages--;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+        pat-&gt;header-&gt;garbages[size2] = rn-&gt;lr[0];</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         PAT_LEN_SET(rn, size);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         grn_memcpy(keybuf, key, size);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       } else {</span>
</pre>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>