Cleanup: apply "lift out..." inspection (+ some others)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
0c41ceea9d
commit
9c06739594
@@ -61,13 +61,13 @@ open class BasicReplStageHistory<T>(override val lock: ReentrantReadWriteLock =
|
||||
lock.write {
|
||||
val idx = indexOfFirst { it.id == id }
|
||||
if (idx < 0) throw java.util.NoSuchElementException("Cannot rest to inexistent line ${id.no}")
|
||||
if (idx < lastIndex) {
|
||||
return if (idx < lastIndex) {
|
||||
val removed = asSequence().drop(idx + 1).map { it.id }.toList()
|
||||
removeRange(idx + 1, size)
|
||||
currentGeneration.incrementAndGet()
|
||||
return removed
|
||||
removed
|
||||
}
|
||||
else return emptyList()
|
||||
else emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user