Skip to content

Commit

Permalink
删除不必要的本地变量赋值
Browse files Browse the repository at this point in the history
  • Loading branch information
codefollower committed Apr 9, 2017
1 parent 0b77baf commit e9f688a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
Expand Up @@ -216,14 +216,12 @@ public Cursor find(ServerSession session, SearchRow first, SearchRow last) {
max = v;
}
}
TransactionMap<Value, VersionedValue> map = getMap(session);
return new StandardPrimaryIndexCursor(session, table, this, map.entryIterator(min), max);
return new StandardPrimaryIndexCursor(session, table, this, getMap(session).entryIterator(min), max);
}

@Override
public Row getRow(ServerSession session, long key) {
TransactionMap<Value, VersionedValue> map = getMap(session);
VersionedValue v = map.get(ValueLong.get(key));
VersionedValue v = getMap(session).get(ValueLong.get(key));
ValueArray array = v.value;
Row row = new Row(array.getList(), 0);
row.setKey(key);
Expand Down Expand Up @@ -256,11 +254,10 @@ public void remove(ServerSession session) {

@Override
public void truncate(ServerSession session) {
TransactionMap<Value, VersionedValue> map = getMap(session);
if (table.getContainsLargeObject()) {
database.getLobStorage().removeAllForTable(table.getId());
}
map.clear();
getMap(session).clear();
}

@Override
Expand Down Expand Up @@ -291,8 +288,7 @@ public boolean needRebuild() {

@Override
public long getRowCount(ServerSession session) {
TransactionMap<Value, VersionedValue> map = getMap(session);
return map.sizeAsLong();
return getMap(session).sizeAsLong();
}

/**
Expand Down Expand Up @@ -349,8 +345,7 @@ ValueLong getKey(SearchRow row, ValueLong ifEmpty, ValueLong ifNull) {
* @return the cursor
*/
Cursor find(ServerSession session, ValueLong first, ValueLong last) {
TransactionMap<Value, VersionedValue> map = getMap(session);
return new StandardPrimaryIndexCursor(session, table, this, map.entryIterator(first), last);
return new StandardPrimaryIndexCursor(session, table, this, getMap(session).entryIterator(first), last);
}

@Override
Expand Down
Expand Up @@ -261,8 +261,7 @@ public Cursor find(ServerSession session, SearchRow first, SearchRow last) {
if (min != null) {
min.getList()[keyColumns - 1] = ValueLong.get(Long.MIN_VALUE);
}
TransactionMap<Value, Value> map = getMap(session);
return new StandardSecondaryIndexCursor(session, map.keyIterator(min), last);
return new StandardSecondaryIndexCursor(session, getMap(session).keyIterator(min), last);
}

private ValueArray convertToKey(SearchRow r) {
Expand Down Expand Up @@ -321,8 +320,7 @@ public void remove(ServerSession session) {

@Override
public void truncate(ServerSession session) {
TransactionMap<Value, Value> map = getMap(session);
map.clear();
getMap(session).clear();
}

@Override
Expand Down Expand Up @@ -361,8 +359,7 @@ public boolean needRebuild() {

@Override
public long getRowCount(ServerSession session) {
TransactionMap<Value, Value> map = getMap(session);
return map.sizeAsLong();
return getMap(session).sizeAsLong();
}

@Override
Expand Down

0 comments on commit e9f688a

Please sign in to comment.