Skip to content

Commit

Permalink
Simplify default properties loading
Browse files Browse the repository at this point in the history
The file path will be checked in `com.pinterest.ktlint.rule.engine.internal.EditorConfigDefaultsLoader.load`, no need to check nullability again.
  • Loading branch information
Goooler committed May 31, 2024
1 parent c3ed2d7 commit db62f50
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,9 @@ public class EditorConfigDefaults(
path: Path?,
propertyTypes: Set<PropertyType<*>>,
): EditorConfigDefaults =
if (path == null) {
EMPTY_EDITOR_CONFIG_DEFAULTS
} else {
EditorConfigDefaultsLoader(
EditorConfigLoaderEc4j(propertyTypes),
).load(path)
}
EditorConfigDefaultsLoader(
EditorConfigLoaderEc4j(propertyTypes),
).load(path)

/**
* Empty representation of [EditorConfigDefaults].
Expand Down

0 comments on commit db62f50

Please sign in to comment.