Skip to content

Commit

Permalink
perf: Early return null
Browse files Browse the repository at this point in the history
  • Loading branch information
sya-ri committed Jun 10, 2024
1 parent 94232e2 commit db80635
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/dev/s7a/ktconfig/KtConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ abstract class KtConfig<T : Any>(
}

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)
Expand Down

0 comments on commit db80635

Please sign in to comment.