From 8d3cdd8572b96efce3ddf3e479fa392c98bbbb1c Mon Sep 17 00:00:00 2001 From: Charles Allen Date: Fri, 11 Sep 2015 16:32:09 -0700 Subject: [PATCH] Don't check for sortedness if we already know GenericIndexedWriter isn't sorted --- .../main/java/io/druid/segment/data/GenericIndexedWriter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/src/main/java/io/druid/segment/data/GenericIndexedWriter.java b/processing/src/main/java/io/druid/segment/data/GenericIndexedWriter.java index e13665e555b..d655232ba8d 100644 --- a/processing/src/main/java/io/druid/segment/data/GenericIndexedWriter.java +++ b/processing/src/main/java/io/druid/segment/data/GenericIndexedWriter.java @@ -66,7 +66,7 @@ public class GenericIndexedWriter 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; }