From 869a7b4995786853af4357d7da2ccc08e9e18c09 Mon Sep 17 00:00:00 2001 From: Gerhard Muth Date: Mon, 16 Dec 2024 10:15:19 +0100 Subject: [PATCH] refactored: substring() -> take() --- .../kotlin/de/gmuth/ipp/iana/IppRegistrationsSection4.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/de/gmuth/ipp/iana/IppRegistrationsSection4.kt b/src/main/kotlin/de/gmuth/ipp/iana/IppRegistrationsSection4.kt index 710558c9..ad695b4f 100644 --- a/src/main/kotlin/de/gmuth/ipp/iana/IppRegistrationsSection4.kt +++ b/src/main/kotlin/de/gmuth/ipp/iana/IppRegistrationsSection4.kt @@ -34,7 +34,7 @@ object IppRegistrationsSection4 { fun getKeywordAttributeValuesForAttribute(attribute: String) = allKeywordAttributeValues .filter { it.attribute == attribute } - .apply { if(isEmpty()) throw IppException("Attribute not found: $attribute") } + .apply { if (isEmpty()) throw IppException("Attribute not found: $attribute") } fun getKeywordValuesForAttribute(attribute: String) = getKeywordAttributeValuesForAttribute(attribute) .filterNot { it.keywordValue.isBlank() || it.keywordValue.contains("Any") } @@ -53,7 +53,7 @@ object IppRegistrationsSection4 { logger.info { "keyword values for $name ($syntax), $collection, $reference}" } } getKeywordValuesForAttribute(attribute) - .groupBy { it.substring(0, 3) } - .forEach { logger.info { "- ${it.value.joinToString(", ")}" } } + .groupBy { it.take(3) } + .forEach { logger.info { it.value.joinToString(", ") } } } } \ No newline at end of file