will R8 do these optimisations automatically? :eye...
# compiler
t
will R8 do these optimisations automatically? 👀
j
Probably a better question for #android since this room is for the Kotlin compiler.
Although since I'm not in there I'll answer here: • The first one is already somewhat equivalent. They only differ by the presence of debug information in the form of line numbers and source files. So as long as you are not keeping those attributes in your release build they produce equivalent code. • The second one is will not be optimized, no. It also has the difference in debug attributes, but R8 isn't going to see through that lambda and remove the added wrapper class.