Skip to content

Commit

Permalink
Cheaper visitKeys for empty tables
Browse files Browse the repository at this point in the history
  • Loading branch information
tinwelint committed May 20, 2016
1 parent f03bd16 commit b669ced
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ private boolean hasDataChanges()
return hasTxStateWithChanges() && txState.hasDataChanges();
}

// Only for test-access
public TransactionRecordState getTransactionRecordState()
{
return recordState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public PrimitiveLongIterator iterator()
@Override
public <E extends Exception> void visitKeys( PrimitiveLongVisitor<E> visitor ) throws E
{
if ( table.isEmpty() )
{
return;
}

int capacity = table.capacity();
long nullKey = table.nullKey();
for ( int i = 0; i < capacity; i++ )
Expand Down

0 comments on commit b669ced

Please sign in to comment.