From 5ce4e4cbc0ec9481535e5ad0305855555f7ca6b0 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 11 Nov 2024 13:37:20 +0600 Subject: [PATCH] fix of modifyRow --- .../src/commonMain/kotlin/dev/inmo/tgbotapi/utils/Matrix.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/Matrix.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/Matrix.kt index 935dc87eb3..7a3a4b56e3 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/Matrix.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/Matrix.kt @@ -97,9 +97,10 @@ open class MatrixBuilder { exists.forEach { rowBuilder.add(it) } mutMatrix[i] = rowBuilder.apply(block).row } - fun modifyRow(row: List, block: RowBuilder.() -> Unit) { + fun modifyRow(row: List, block: RowBuilder.() -> Unit): Boolean { val i = mutMatrix.indexOf(row).takeIf { it > -1 } ?: return false modifyRow(i, block) + return true } fun remove(i: Int): List { return mutMatrix.removeAt(i)