This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.simon.sample | |
import com.simon.sample.CollectionRange.to100 | |
import com.simon.sample.CollectionRange.to1000 | |
import com.simon.sample.CollectionRange.to10000 | |
import com.simon.sample.CollectionRange.to100000 | |
import com.simon.sample.CollectionRange.to1000000 | |
import kotlin.system.measureTimeMillis | |
enum class CollectionType { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun doubleup(num: Int) : Int = num * 2 | |
fun addOrDouble(a: Int, b: Int?): Int = b?.let { it + a } ?: doubleup(a) |