Skip to content

Commit 82bb0ec

Browse files
committed
Fix IntelliJ complaint due to negated if condition
1 parent 1db845a commit 82bb0ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ public void insertRecord(
265265

266266
public UnsafeSorterIterator getSortedIterator() throws IOException {
267267
final UnsafeSorterIterator inMemoryIterator = sorter.getSortedIterator();
268-
if (!spillWriters.isEmpty()) {
268+
if (spillWriters.isEmpty()) {
269+
return inMemoryIterator;
270+
} else {
269271
final UnsafeSorterSpillMerger spillMerger =
270272
new UnsafeSorterSpillMerger(recordComparator, prefixComparator);
271273
for (UnsafeSorterSpillWriter spillWriter : spillWriters) {
@@ -276,8 +278,6 @@ public UnsafeSorterIterator getSortedIterator() throws IOException {
276278
spillMerger.addSpill(inMemoryIterator);
277279
}
278280
return spillMerger.getSortedIterator();
279-
} else {
280-
return inMemoryIterator;
281281
}
282282
}
283283
}

0 commit comments

Comments
 (0)