From 79675593a92a63bdec1680421b4b5ea8fcda7658 Mon Sep 17 00:00:00 2001 From: BOOMeranGG Date: Fri, 9 Dec 2022 00:15:22 +0300 Subject: [PATCH] Rewrite takeBeforeComment and trimComment functions --- .../kotlin/com/akuleshov7/ktoml/parsers/StringUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/parsers/StringUtils.kt b/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/parsers/StringUtils.kt index 7b77cd0b..1abc9fda 100644 --- a/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/parsers/StringUtils.kt +++ b/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/parsers/StringUtils.kt @@ -184,7 +184,7 @@ private fun String.getCommentStartIndex(): Int { chars.forEachIndexed { idx, symbol -> // take hash index if it's not enclosed in quotation marks - if (currentQuoteChar == null && symbol == '#') { + if (symbol == '#' && currentQuoteChar == null) { return idx }