mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-27 20:48:44 +00:00
fix of modifyRow
This commit is contained in:
parent
41e369cea5
commit
5ce4e4cbc0
@ -97,9 +97,10 @@ open class MatrixBuilder<T> {
|
|||||||
exists.forEach { rowBuilder.add(it) }
|
exists.forEach { rowBuilder.add(it) }
|
||||||
mutMatrix[i] = rowBuilder.apply(block).row
|
mutMatrix[i] = rowBuilder.apply(block).row
|
||||||
}
|
}
|
||||||
fun modifyRow(row: List<T>, block: RowBuilder<T>.() -> Unit) {
|
fun modifyRow(row: List<T>, block: RowBuilder<T>.() -> Unit): Boolean {
|
||||||
val i = mutMatrix.indexOf(row).takeIf { it > -1 } ?: return false
|
val i = mutMatrix.indexOf(row).takeIf { it > -1 } ?: return false
|
||||||
modifyRow(i, block)
|
modifyRow(i, block)
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
fun remove(i: Int): List<T> {
|
fun remove(i: Int): List<T> {
|
||||||
return mutMatrix.removeAt(i)
|
return mutMatrix.removeAt(i)
|
||||||
|
Loading…
Reference in New Issue
Block a user