Skip to content

Commit

Permalink
Update replicator/src/main/scala/com/evolutiongaming/kafka/journal/re…
Browse files Browse the repository at this point in the history
…plicator/Batch.scala

Co-authored-by: Ruslans Tarasovs <[email protected]>
  • Loading branch information
mr-git and rtar authored Oct 25, 2024
1 parent 2072385 commit 002fc36
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,9 @@ private[journal] object Batch {
val deleteTo = this.delete.map(_.to.value)
val records = appends.records
val actions =
if (deleteTo.contains(records.head.action.range.to) && records.tail.nonEmpty) appends.records.tail
else appends.records.toList
NonEmptyList.fromList(actions) match {
case Some(actions) => appends.copy(records = actions).some
case None => appends.some // cannot happen
}
if (deleteTo.contains(records.head.action.range.to)) NonEmptyList.fromList(records.tail).getOrElse(records)
else records
appends.copy(records = actions).some
}
}

Expand Down

0 comments on commit 002fc36

Please sign in to comment.