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:
oxmc
2026-07-15 15:50:56 -07:00
parent d9081fab59
commit 294b7ee0db
@@ -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)
}