From db80635983c7eca1273f90b760fd9b1309042ffb Mon Sep 17 00:00:00 2001 From: sya-ri Date: Sat, 8 Jun 2024 21:21:28 +0900 Subject: [PATCH] perf: Early return null --- src/main/kotlin/dev/s7a/ktconfig/KtConfig.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/dev/s7a/ktconfig/KtConfig.kt b/src/main/kotlin/dev/s7a/ktconfig/KtConfig.kt index bf647e3..d1e16c2 100644 --- a/src/main/kotlin/dev/s7a/ktconfig/KtConfig.kt +++ b/src/main/kotlin/dev/s7a/ktconfig/KtConfig.kt @@ -23,8 +23,8 @@ abstract class KtConfig( } protected fun loadFromString(text: String): T? { - val section = ContentSerializer().section(clazz, type, ProjectionMap(clazz, type)) if (text.isBlank()) return null + val section = ContentSerializer().section(clazz, type, ProjectionMap(clazz, type)) val values = YamlConfiguration().apply { options().pathSeparator(PATH_SEPARATOR)