with

abstract fun with(size: Size): Size

Returns itself if it is equal to the supplied size, otherwise the supplied size. You can use this if you have a size field which is frequently recalculated but often resolves to the same size; it will keep the same object in memory instead of swapping it out every cycle.

Sources

(source)
Link copied to clipboard