[Groonga-commit] groonga/grnxx [master] Fix branch conditions.

Zurück zum Archiv-Index

susumu.yata null+****@clear*****
Thu Mar 21 11:51:38 JST 2013


susumu.yata	2013-03-21 11:51:38 +0900 (Thu, 21 Mar 2013)

  New Revision: cc41051d33b01989b42ce2d849568a3e442dce93
  https://github.com/groonga/grnxx/commit/cc41051d33b01989b42ce2d849568a3e442dce93

  Message:
    Fix branch conditions.

  Modified files:
    lib/map/da/basic/predictive_cursor.cpp

  Modified: lib/map/da/basic/predictive_cursor.cpp (+3 -3)
===================================================================
--- lib/map/da/basic/predictive_cursor.cpp    2013-03-17 20:04:59 +0900 (2341cff)
+++ lib/map/da/basic/predictive_cursor.cpp    2013-03-21 11:51:38 +0900 (87ffc41)
@@ -63,7 +63,7 @@ void PredictiveCursor::open_cursor(Trie *trie, MapCursorFlags flags,
   for (size_t i = 0; i < min.size(); ++i) {
     const Node node = trie_->nodes_[node_id];
     if (node.is_leaf()) {
-      if (offset == 0) {
+      if (offset <= 0) {
         const Key &key = trie_->get_key(node.key_pos());
         if ((key.size() >= min_size_) &&
             (key.slice().subslice(i, min.size() - i) ==
@@ -111,7 +111,7 @@ bool PredictiveCursor::ascending_next() try {
     if (node.is_leaf()) {
       const Key &key = trie_->get_key(node.key_pos());
       if (key.size() >= min_size_) {
-        if (offset_ != 0) {
+        if (offset_ > 0) {
           --offset_;
         } else if (limit_ != 0) {
           key_id_ = key.id();
@@ -142,7 +142,7 @@ bool PredictiveCursor::descending_next() try {
       if (node.is_leaf()) {
         const Key &key = trie_->get_key(node.key_pos());
         if (key.size() >= min_size_) {
-          if (offset_ != 0) {
+          if (offset_ > 0) {
             --offset_;
           } else if (limit_ != 0) {
             key_id_ = key.id();
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index