Merge pull request #1725 from metamx/genericIndexedWriteOptimizationObjectsSorted

Don't check for sortedness if we already know GenericIndexedWriter isn't sorted
This commit is contained in:
Xavier Léauté 2015-09-11 22:33:53 -07:00
commit 43012d3c48
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;
}