Don't check for sortedness if we already know GenericIndexedWriter isn't sorted

This commit is contained in:
Charles Allen 2015-09-11 16:32:09 -07:00
parent 07266d682a
commit 8d3cdd8572
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ public class GenericIndexedWriter<T> implements Closeable
public void write(T objectToWrite) throws IOException
{
if (prevObject != null && strategy.compare(prevObject, objectToWrite) >= 0) {
if (objectsSorted && prevObject != null && strategy.compare(prevObject, objectToWrite) >= 0) {
objectsSorted = false;
}