mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
IJPL-157370 Refactor LocalizationUtil
Unnecessary conversion toList() before calling distinct() was removed in getLocalizedPathsWithDefault function, apply replaced to let. And removed redundant invocation with let in the getResourceAsStream method. GitOrigin-RevId: da3536ac3923036600910960c6cb405929545e57
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a9d4798099
commit
98ce361a93
@@ -99,16 +99,16 @@ object LocalizationUtil {
|
||||
defaultLoader?.getResourceAsStream(pathString)?.let { return it }
|
||||
}
|
||||
return getPluginClassLoader()?.getResourceAsStream(path.pathString) ?:
|
||||
defaultLoader?.getResourceAsStream(path.pathString)?.let { return it }
|
||||
defaultLoader?.getResourceAsStream(path.pathString)
|
||||
}
|
||||
|
||||
@Internal
|
||||
@JvmOverloads
|
||||
fun getLocalizedPathsWithDefault(path: Path, specialLocale: Locale? = null): List<Path> {
|
||||
val locale = specialLocale ?: getLocale()
|
||||
return getLocalizedPaths(path, locale).toMutableList().apply {
|
||||
add(path)
|
||||
toList().distinct()
|
||||
return getLocalizedPaths(path, locale).toMutableList().let {
|
||||
it.add(path)
|
||||
it.distinct()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user