Code cleanup: get rid of unnecessary !! / ?. / as
This commit is contained in:
+1
-1
@@ -35,7 +35,7 @@ class AndroidXmlHandler(private val elementCallback: (String, String) -> Unit) :
|
||||
val attributesMap = attributes.toMap()
|
||||
val idAttribute = attributesMap[AndroidConst.ID_ATTRIBUTE_NO_NAMESPACE]
|
||||
val widgetType = attributesMap[AndroidConst.CLASS_ATTRIBUTE_NO_NAMESPACE] ?: localName
|
||||
val name = idAttribute?.let { idToName(idAttribute!!) }
|
||||
val name = idAttribute?.let { idToName(idAttribute) }
|
||||
if (name != null) elementCallback(name, widgetType)
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -132,8 +132,8 @@ public class AndroidRenameProcessor : RenamePsiElementProcessor() {
|
||||
oldPropName: String,
|
||||
processor: SyntheticFileGenerator
|
||||
) {
|
||||
val props = processor.getSyntheticFiles()?.flatMap { it.findChildrenByClass(javaClass<KtProperty>()).toList() }
|
||||
val matchedProps = props?.filter { it.getName() == oldPropName } ?: listOf()
|
||||
val props = processor.getSyntheticFiles().flatMap { it.findChildrenByClass(javaClass<KtProperty>()).toList() }
|
||||
val matchedProps = props.filter { it.getName() == oldPropName } ?: listOf()
|
||||
for (prop in matchedProps) {
|
||||
allRenames[prop] = newPropName
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user