Skip to content
Closed
Prev Previous commit
Next Next commit
one more place
  • Loading branch information
zsxwing committed Aug 21, 2018
commit f379d47e30643fe92b751aa7aa374815ac66a55c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ private[kafka010] case class InternalKafkaConsumer(
if (!fetchedData.hasNext()) {
assert(offset <= offsetAfterPoll,
s"seek to $offset and poll but the offset was reset to $offsetAfterPoll")
FetchedRecord(null, offsetAfterPoll)
fetchedRecord.withRecord(null, offsetAfterPoll)
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this else and reduce the condition nesting. The previous if statement always ends in an exception, so we can remove this else.

val record = fetchedData.next()
nextOffsetInFetchedData = record.offset + 1
Expand Down