Permalink
Browse files

Cleaned up BST iterators

  • Loading branch information...
tzaeschke committed Jun 9, 2018
1 parent 8fe001c commit b08c36ceb3f7d65c1eeaeb5b7185ba27f69cc2e2
View
@@ -50,7 +50,7 @@ Released version 2.0.0 of the PH-Tree (partial reimplementation). There are thre
* Internal B+Tree structure (with configurable page sizes) makes it more suitable for disk based storage.
* **API Contract Change**: The PH-Tree now stores keys (long[]/double[]) internally. Modifying them
after storing them in the tree will make the tree invalid.
- The `PhTree` factory class will automatically choose one of v13, v16 and v16HD, depending on the number of dimensions.
### 2017-09-17
@@ -79,24 +79,23 @@ private boolean findFirstLeafPage() {
}
private void findNext() {
while (currentPage != null ) {
//first progress to next page, if necessary.
if (currentPos >= currentPage.getNKeys()) {
currentPage = currentPage.getNextLeaf();
currentPos = 0;
continue;
}
long key = currentPage.getKeys()[currentPos];
if (check(key)) {
nextValue = currentPage.getValues()[currentPos];
currentPos++;
return;
} else if (key > maxMask) {
currentPage = null;
return;
}
currentPos++;
while (currentPage != null) {
int nKeys = currentPage.getNKeys();
long[] keys = currentPage.getKeys();
while (currentPos < nKeys) {
long key = keys[currentPos];
if (check(key)) {
nextValue = currentPage.getValues()[currentPos];
currentPos++;
return;
} else if (key > maxMask) {
currentPage = null;
return;
}
currentPos++;
}
currentPage = currentPage.getNextLeaf();
currentPos = 0;
}
}
@@ -52,19 +52,19 @@ private boolean findFirstLeafPage() {
return true;
}
private void findNext() {
while (currentPage != null ) {
//first progress to next page, if necessary.
if (currentPos >= currentPage.getNKeys()) {
currentPage = currentPage.getNextLeaf();
currentPos = 0;
continue;
//first progress to next page, if necessary.
if (currentPos >= currentPage.getNKeys()) {
currentPage = currentPage.getNextLeaf();
if (currentPage == null) {
return;
}
nextValue = currentPage.getValues()[currentPos];
currentPos++;
return;
currentPos = 0;
}
nextValue = currentPage.getValues()[currentPos];
currentPos++;
}

0 comments on commit b08c36c

Please sign in to comment.