Permalink
Browse files

Changed Int to "лист"

From https://kotlinlang.org/docs/reference/extensions.html :

fun MutableList<Int>.swap(index1: Int, index2: Int) {
    val tmp = this[index1] // 'this' corresponds to the list
    this[index1] = this[index2]
    this[index2] = tmp
}
  • Loading branch information...
icarumbas committed Nov 5, 2017
1 parent de559aa commit 868f3296b376d5dc6adebe6691e97d061be88676
Showing with 1 addition and 1 deletion.
  1. +1 −1 extensions.md
View
@@ -23,7 +23,7 @@ The following adds a `swap` function to `MutableList<Int>`:-->
``` kotlin
fun MutableList<Int>.swap(index1: Int, index2: Int) {
val tmp = this[index1] // 'this' даёт ссылку на Int
val tmp = this[index1] // 'this' даёт ссылку на лист
this[index1] = this[index2]
this[index2] = tmp
}

0 comments on commit 868f329

Please sign in to comment.