Rev 37: Really fix the case of handling empty internal nodes - such nodes represent a right hand edge where there is only one child node of the internal node. in http://people.ubuntu.com/~robertc/baz2.0/plugins/index2/trunk

Robert Collins robertc at robertcollins.net
Mon Jul 14 15:50:58 BST 2008


At http://people.ubuntu.com/~robertc/baz2.0/plugins/index2/trunk

------------------------------------------------------------
revno: 37
revision-id: robertc at robertcollins.net-20080714145057-9ac8y9a3pe1py25n
parent: robertc at robertcollins.net-20080714135018-xu35fmg5ivjtnlbx
committer: Robert Collins <robertc at robertcollins.net>
branch nick: trunk
timestamp: Tue 2008-07-15 00:50:57 +1000
message:
  Really fix the case of handling empty internal nodes - such nodes represent a right hand edge where there is only one child node of the internal node.
modified:
  btree_index.py                 index.py-20080624222253-p0x5f92uyh5hw734-7
=== modified file 'btree_index.py'
--- a/btree_index.py	2008-07-14 13:50:18 +0000
+++ b/btree_index.py	2008-07-14 14:50:57 +0000
@@ -836,7 +836,9 @@
         if not in_keys:
             return []
         if not fixed_keys:
-            raise AssertionError('we must have entries in fixed_keys')
+            # no pointers in the fixed_keys list, which means everything must
+            # fall to the left.
+            return [0 for key in in_keys]
 
         # TODO: Iterating both lists will generally take M + N steps
         #       Bisecting each key will generally take M * log2 N steps.
@@ -1012,10 +1014,6 @@
                 #             bloom_hits[1] += 1
                 #             bisect.insort(missing_keys, sub_key)
                 #     sub_keys = remaining_sub_keys
-                if not node.keys:
-                    # Empty node - rare bug in the generator, but it means all
-                    # keys are missing.
-                    continue
                 positions = self._multi_bisect_right(sub_keys, node.keys)
                 node_offset = next_row_start + node.offset
                 next_nodes_and_keys.extend([(node_offset + pos, s_keys)




More information about the bazaar-commits mailing list