Add intention to replace "Map.getOrDefault"
#KT-21503 Fixed
This commit is contained in:
committed by
Ilya Kirillov
parent
e09ae645b3
commit
f5c0a30c51
@@ -0,0 +1,3 @@
|
||||
fun test(map: Map<Int, String>) {
|
||||
map<spot>[1] ?: "foo"</spot>
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun test(map: Map<Int, String>) {
|
||||
map<spot>.getOrDefault(1, "foo")</spot>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
This intention replaces <b>map.getOrDefault(key, defaultValue)</b> function calls with the indexing and elvis operator (<b>map[key] ?: defaultValue</b>).
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user