Pattern: Missing use of indexed access operator []
Issue: -
Prefer the usage of the indexed access operator []
for map or list element access or insert methods.
Example of incorrect code:
val map = Map<String, String>()
map.put("key", "value")
val value = map.get("key")
Example of correct code:
val map = Map<String, String>()
map["key"] = "value"
val value = map["key"]