AltDeviceNames: qualify the entries reference inside buildMap
buildMap's MutableMap receiver has its own .entries, which shadows the object's device list and breaks the index-building loop.
This commit is contained in:
@@ -104,7 +104,9 @@ object AltDeviceNames {
|
||||
// Index built at class init: model (uppercase) → entries that contain that model.
|
||||
// O(1) first-level lookup; secondary filter is O(small) since model collisions are rare.
|
||||
private val byModel: Map<String, List<Entry>> = buildMap<String, MutableList<Entry>> {
|
||||
for (entry in entries) {
|
||||
// Must be qualified: inside buildMap the receiver's MutableMap.entries
|
||||
// shadows this object's device list.
|
||||
for (entry in AltDeviceNames.entries) {
|
||||
for (model in entry.models) {
|
||||
getOrPut(model.uppercase()) { mutableListOf() }.add(entry)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user