A great thing about Kotlin is high-order functions that let us use functions as parameters to other functions. However, they are objects, so they present memory overhead (because every instance is allocated space in heap, and we need methods for calling the functions too). We can improve the situation using inline functions. Inline annotation means that the specific function, along with the function parameters, will be expanded at the call site; this helps reduce call overhead.
Similarly, the inline keyword can be used with properties and property accessors that do not have the backing field. Let's see how in this recipe.