Merge stored empty lists and sets to singe object

This commit is contained in:
Nikolay Krasko
2014-11-02 01:15:07 +03:00
parent 87d372aad5
commit 7e1546d3e7
6 changed files with 28 additions and 19 deletions
@@ -100,7 +100,7 @@ public abstract class LazyJavaMemberScope(
}
}
ArrayList(functions)
functions.toReadOnlyList()
}
data class MethodSignatureData(
@@ -237,8 +237,7 @@ public abstract class LazyJavaMemberScope(
computeNonDeclaredProperties(name, properties)
properties.trimToSize()
properties
properties.toReadOnlyList()
}
private fun resolveProperty(field: JavaField): PropertyDescriptor {
@@ -303,7 +302,7 @@ public abstract class LazyJavaMemberScope(
override fun getOwnDeclaredDescriptors() = getAllDescriptors()
override fun getAllDescriptors() = _allDescriptors()
private fun computeAllDescriptors(): MutableCollection<DeclarationDescriptor> {
private fun computeAllDescriptors(): List<DeclarationDescriptor> {
val result = LinkedHashSet<DeclarationDescriptor>()
for (name in getAllClassNames()) {
@@ -324,7 +323,7 @@ public abstract class LazyJavaMemberScope(
addExtraDescriptors(result)
return ArrayList(result)
return result.toReadOnlyList()
}
protected open fun addExtraDescriptors(result: MutableSet<DeclarationDescriptor>) {