Skip to content

Commit a443531

Browse files
committed
Refine comment
1 parent 3087208 commit a443531

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

core/src/main/scala/org/apache/spark/util/collection/ExternalAppendOnlyMap.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,14 +540,10 @@ class ExternalAppendOnlyMap[K, V, C](
540540
}
541541

542542
override def next(): (K, C) = {
543-
if (deserializeStream == null) {
544-
// In case of deserializeStream has not been initialized when call next() directly
545-
deserializeStream = nextBatchStream()
546-
}
547-
val item = if (nextItem == null) readNextItem() else nextItem
548-
if (item == null) {
543+
if (!hasNext) {
549544
throw new NoSuchElementException
550545
}
546+
val item = nextItem
551547
nextItem = null
552548
item
553549
}

0 commit comments

Comments
 (0)