sort and binarySearch methods now have correct default toIndex parameter #KT-4963 Fixed

This commit is contained in:
Ilya Ryzhenkov
2014-05-07 17:11:54 +04:00
committed by Andrey Breslav
parent 9ec78a437d
commit 178ae83e8d
3 changed files with 26 additions and 18 deletions
@@ -53,7 +53,7 @@ fun specialJVM(): List<GenericFunction> {
}
}
templates add f("binarySearch(element: T, fromIndex: Int = 0, toIndex: Int = size - 1)") {
templates add f("binarySearch(element: T, fromIndex: Int = 0, toIndex: Int = size)") {
only(ArraysOfObjects, ArraysOfPrimitives)
exclude(PrimitiveType.Boolean)
doc { "Searches array or range of array for provided element index using binary search algorithm. Array is expected to be sorted." }
@@ -63,7 +63,7 @@ fun specialJVM(): List<GenericFunction> {
}
}
templates add f("sort(fromIndex: Int = 0, toIndex: Int = size - 1)") {
templates add f("sort(fromIndex: Int = 0, toIndex: Int = size)") {
only(ArraysOfObjects, ArraysOfPrimitives)
exclude(PrimitiveType.Boolean)
doc { "Sorts array or range in array inplace" }