Hullaballoonatic
11/20/2019, 11:34 PMtoString
given that it never changes, or should I create a backing field?
class Foo(val str: String) {
override fun toString() = str.reversed()
.repeat(1000)
.trim()
.otherStuff()
}
Dominaezzz
11/20/2019, 11:35 PMHullaballoonatic
11/20/2019, 11:35 PMstreetsofboston
11/20/2019, 11:36 PMreversed
, repeat
, trim
and otherStuff
have side-effects or not… It can’t optimize this.