Given that the compiler can optimize ranges, which of the following range-based for-loops do you think is the most efficient? // Option 1 No allocations necessary! Range Against The Machine In other words, when endInclusive urlThumbĪgain, the above compiles to a series of simple conditionals. ![]() That's because IntRange is defined by its minimum start and its maximum endInclusive values. If you think the answer is 123321, guess again. ![]() ![]() Pop quiz: What does the following code output? (1.3).forEach(System.out::print) Here are a few interesting aspects of Kotlin ranges, some of which I've found to be less-than-intuitive.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |