7ce0487b7e
Lists - For arrays, use Arrays.asList, then toArrayList making the list creation an array copy - For the same reason, use the ArrayList(Collection) constructor - Replace duplicate code in toList, instead calling toArrayList Maps/Sets - Where the size of the source is known, precalculate the capacity, using the formula used by Guava's Maps class - For toMap where we're unable to get at the private function, use HashSet's formula where the size is known - Add a toMap that takes a selector and a transform, avoiding a separate step for transforming values
The Kotlin Standard Library
This module creates the standard library for kotlin.
Notes for contributors
We use some code generation to apply the various collection-like methods to various different types like arrays, strings, kotlin.Iterable and java.lang.Iterable etc.
To run the code generator from a kotlin checkout
cd libraries/tools/kotlin-stdlib-gen
mvn compile exec:java
This then runs the GenerateStandardLib.kt script to create the source from the files for java.lang.Iterable and java.util.Collection etc.