提交 7bf562df authored 作者: noelgrandin's avatar noelgrandin

improve var name - "id" is a little too generic in this context

上级 6c4afa7b
...@@ -104,9 +104,9 @@ public class IndexCursor implements Cursor { ...@@ -104,9 +104,9 @@ public class IndexCursor implements Cursor {
Value v = condition.getCurrentValue(s); Value v = condition.getCurrentValue(s);
boolean isStart = condition.isStart(); boolean isStart = condition.isStart();
boolean isEnd = condition.isEnd(); boolean isEnd = condition.isEnd();
int id = column.getColumnId(); int columnId = column.getColumnId();
if (id >= 0) { if (columnId >= 0) {
IndexColumn idxCol = indexColumns[id]; IndexColumn idxCol = indexColumns[columnId];
if (idxCol != null && (idxCol.sortType & SortOrder.DESCENDING) != 0) { if (idxCol != null && (idxCol.sortType & SortOrder.DESCENDING) != 0) {
// if the index column is sorted the other way, we swap end and start // if the index column is sorted the other way, we swap end and start
// NULLS_FIRST / NULLS_LAST is not a problem, as nulls never match anyway // NULLS_FIRST / NULLS_LAST is not a problem, as nulls never match anyway
...@@ -116,10 +116,10 @@ public class IndexCursor implements Cursor { ...@@ -116,10 +116,10 @@ public class IndexCursor implements Cursor {
} }
} }
if (isStart) { if (isStart) {
start = getSearchRow(start, id, v, true); start = getSearchRow(start, columnId, v, true);
} }
if (isEnd) { if (isEnd) {
end = getSearchRow(end, id, v, false); end = getSearchRow(end, columnId, v, false);
} }
if (isStart || isEnd) { if (isStart || isEnd) {
// an X=? condition will produce less rows than // an X=? condition will produce less rows than
...@@ -163,16 +163,16 @@ public class IndexCursor implements Cursor { ...@@ -163,16 +163,16 @@ public class IndexCursor implements Cursor {
return idxCol == null || idxCol.column == column; return idxCol == null || idxCol.column == column;
} }
private SearchRow getSearchRow(SearchRow row, int id, Value v, boolean max) { private SearchRow getSearchRow(SearchRow row, int columnId, Value v, boolean max) {
if (row == null) { if (row == null) {
row = table.getTemplateRow(); row = table.getTemplateRow();
} else { } else {
v = getMax(row.getValue(id), v, max); v = getMax(row.getValue(columnId), v, max);
} }
if (id < 0) { if (columnId < 0) {
row.setKey(v.getLong()); row.setKey(v.getLong());
} else { } else {
row.setValue(id, v); row.setValue(columnId, v);
} }
return row; return row;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论