Hildebrandt Tobias
04/11/2024, 8:49 AMfun getDeviceUpdater(id: DeviceId): DeviceUpdater {
if(!deviceMap.containsKey(id))
deviceMap[id] = Device()
return deviceMap[id].toDeviceUpdater()!!
}
I don't want to make the return type nullable.Sam
04/11/2024, 8:50 AMdeviceMap.getOrPut(id) { Device() }
Hildebrandt Tobias
04/11/2024, 8:51 AMkqr
04/11/2024, 8:52 AMSam
04/11/2024, 8:54 AMSam
04/11/2024, 8:56 AMHildebrandt Tobias
04/11/2024, 8:57 AMHildebrandt Tobias
04/11/2024, 8:58 AMchristophsturm
04/11/2024, 8:59 AMchristophsturm
04/11/2024, 8:59 AMHildebrandt Tobias
04/11/2024, 9:01 AMchristophsturm
04/11/2024, 9:02 AMHildebrandt Tobias
04/11/2024, 9:04 AMIvan Pavlov
04/11/2024, 11:25 AMdeviceMap.computeIfAbsent(id) { Device() }
andylamax
04/12/2024, 9:26 AMHildebrandt Tobias
04/12/2024, 12:54 PM