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