mutableIntStateOf, mutableLongStateOf, mutableDoubleStateOf, mutableFloatStateOf are essentially counterparts to mutableStateOf, but with the added advantage of circumventing autoboxing on JVM platforms. This distinction renders them more memory efficient, making them the preferable choice when dealing with primitive types such as double, float, int, and long.
There is an official lint rule already for this, but lint won't help with KMP projects like the one I work on at my day job, so detecting this is useful anyway.
mutableIntStateOf
,mutableLongStateOf
,mutableDoubleStateOf
,mutableFloatStateOf
are essentially counterparts tomutableStateOf
, but with the added advantage of circumventing autoboxing on JVM platforms. This distinction renders them more memory efficient, making them the preferable choice when dealing with primitive types such as double, float, int, and long.There is an official lint rule already for this, but lint won't help with KMP projects like the one I work on at my day job, so detecting this is useful anyway.