@Composable
private fun VerticalSpacer(size: Dp) {
Spacer(modifier = Modifier.height(size))
}
Does creating helpers like this add some overhead?
l
Loney Chou
12/15/2022, 3:27 AM
Not much. If you really care about it, annotate this Composable with
NonRestartableComposable
. See its doc for explanation.
u
ursus
12/15/2022, 3:38 AM
how about making it
inline
?
s
Stylianos Gakis
12/15/2022, 12:51 PM
Simply making this inline sounds like exactly what you want, since it’d act as close as possible to how it’d be if you never introduced this function. Don’t think more than that tbh, unless you profile this and somehow see that it’s a problem, which I highly doubt