提交 b81fe715 authored 作者: Jacek Ławrynowicz's avatar Jacek Ławrynowicz

cleanup - use while loops instead of incomplete for loops

上级 69adc4ee
......@@ -205,7 +205,7 @@ public class PageBtreeLeaf extends PageBtree {
PageBtree split(int splitPoint) {
int newPageId = index.getPageStore().allocatePage();
PageBtreeLeaf p2 = PageBtreeLeaf.create(index, newPageId, parentPageId);
for (; splitPoint < entryCount; ) {
while (splitPoint < entryCount) {
p2.addRow(getRow(splitPoint), false);
removeRow(splitPoint);
}
......
......@@ -250,7 +250,7 @@ public class PageBtreeNode extends PageBtree {
}
int firstChild = childPageIds[splitPoint];
readAllRows();
for (; splitPoint < entryCount; ) {
while (splitPoint < entryCount) {
p2.addChild(p2.entryCount, childPageIds[splitPoint + 1], getRow(splitPoint));
removeChild(splitPoint);
}
......
......@@ -370,7 +370,7 @@ public class PageDataLeaf extends PageData {
PageData split(int splitPoint) {
int newPageId = index.getPageStore().allocatePage();
PageDataLeaf p2 = PageDataLeaf.create(index, newPageId, parentPageId);
for (; splitPoint < entryCount; ) {
while (splitPoint < entryCount) {
int split = p2.addRowTry(getRowAt(splitPoint));
if (split != -1) {
DbException.throwInternalError("split " + split);
......
......@@ -172,7 +172,7 @@ public class PageDataNode extends PageData {
int newPageId = index.getPageStore().allocatePage();
PageDataNode p2 = PageDataNode.create(index, newPageId, parentPageId);
int firstChild = childPageIds[splitPoint];
for (; splitPoint < entryCount; ) {
while (splitPoint < entryCount) {
p2.addChild(p2.entryCount, childPageIds[splitPoint + 1], keys[splitPoint]);
removeChild(splitPoint);
}
......
......@@ -224,7 +224,7 @@ public final class JoinBatch {
}
return false;
}
for (;;) {
while (true) {
if (!found) {
if (!batchedNext()) {
return false;
......@@ -272,7 +272,7 @@ public final class JoinBatch {
jfId--;
}
for (;;) {
while (true) {
fetchCurrent(jfId);
if (!current.isDropped()) {
......@@ -359,7 +359,7 @@ public final class JoinBatch {
assert c != null;
JoinFilter join = jf.join;
for (;;) {
while (true) {
if (c == null || !c.next()) {
if (newCursor && jf.isOuterJoin()) {
// replace cursor with null-row
......
......@@ -376,7 +376,7 @@ public class TableFilter implements ColumnResolver {
}
// check if we are at the top table filters all the way up
SubQueryInfo info = session.getSubQueryInfo();
for (;;) {
while (true) {
if (info == null) {
return true;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论