Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Unified Diff: pkg/analysis_server/lib/src/index/b_plus_tree.dart

Issue 338503002: Backport B+ tree implementation from Dart to Java. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/index/b_plus_tree.dart
diff --git a/pkg/analysis_server/lib/src/index/b_plus_tree.dart b/pkg/analysis_server/lib/src/index/b_plus_tree.dart
index a37edbaba785a07ea2a4b00207ec8a1afad488f1..f4b52d7c5a93a586fb1be8b92feed3889c589566 100644
--- a/pkg/analysis_server/lib/src/index/b_plus_tree.dart
+++ b/pkg/analysis_server/lib/src/index/b_plus_tree.dart
@@ -154,14 +154,14 @@ class BPlusTree<K, V, N> {
* Writes [node] into the manager.
*/
void _writeIndexNode(_IndexNode<K, V, N> node) {
- _manager.writeIndex(node.id, new IndexNodeData(node.keys, node.children));
+ _manager.writeIndex(node.id, new IndexNodeData<K, N>(node.keys, node.children));
}
/**
* Writes [node] into the manager.
*/
void _writeLeafNode(_LeafNode<K, V, N> node) {
- _manager.writeLeaf(node.id, new LeafNodeData(node.keys, node.values));
+ _manager.writeLeaf(node.id, new LeafNodeData<K, V>(node.keys, node.values));
}
}
@@ -440,7 +440,7 @@ class _IndexNode<K, V, N> extends _Node<K, V, N> {
// Try right sibling.
if (right is _IndexNode<K, V, N>) {
// Try to redistribute.
- var rightLength = right.keys.length;
+ int rightLength = right.keys.length;
if (rightLength > minKeys) {
int halfExcess = (rightLength - minKeys + 1) ~/ 2;
keys.add(anchor);
@@ -611,7 +611,7 @@ class _LeafNode<K, V, N> extends _Node<K, V, N> {
// Try right sibling.
if (right is _LeafNode<K, V, N>) {
// Try to redistribute.
- var rightLength = right.keys.length;
+ int rightLength = right.keys.length;
if (rightLength > minKeys) {
int halfExcess = (rightLength - minKeys + 1) ~/ 2;
keys.addAll(right.keys.getRange(0, halfExcess));
« no previous file with comments | « editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/index/structure/btree/BPlusTreeTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698